andyp

  • *
  • 42
Compiling Librepilot in Windows 10 - problems and solutions
« on: March 27, 2021, 01:25:48 pm »
I just tried to complile librepilot with Windows 10 and an error occured, as Python3 uses a different syntax that Python2. Therefore

/make/scripts/version-info.py

has to be ported to Python3. I tried it, but it was easier to use Python2, as there have to be many changed done.

Use

pacman -S mingw-w64-x86_64-python2

to install Python 2 on MSys64. Then go to C:\msys64\mingw64\bin folder or x32 folder and replace Python.exe with the version 2, which is available after installation.

Then the make process works with some warnings.
« Last Edit: April 01, 2021, 11:46:17 pm by andyp »

Re: Compiling Librepilot in Windows 10 - port version-info.py to Python3
« Reply #1 on: March 29, 2021, 10:18:54 am »
Good to know!

How much have you tested?  Does GCS run?  Can you use all the GCS pages?  Have you built / flashed / tested firmware?

A month ago I started the process of getting it building and running on a current Linux install.

After making some ?judicious? choices on versions of QT and Osg(Earth) and some obvious code changes, I got it building, but there are some things that will need more changes.  I got it working 100% (including OsgEarth) by copying over some old system libs here and linking new libraries to some old lib names there (a hack to see how far I could get) to fix the "missing lib popups" at startup and some missing entry points.

Without some old libs, OsgEarth segfaults IIRC.  Next step would be to narrow down which libs must be the old version to narrow down where in code the issues are.  And do a debug build to run it under a debugger.  As I recall, with OsgEarth disabled, GCS functions OK, but segfaults on exit.  Firmware builds fine.
« Last Edit: March 29, 2021, 10:23:52 am by TheOtherCliff »

andyp

  • *
  • 42
Compiling Librepilot in Windows 10 - problems and solutions
« Reply #2 on: April 01, 2021, 11:46:01 pm »
You need to install gstreamer development tools as well

pacman -S mingw-w64-x86_64-gst-devtools

Now I am stuck here, seems like a problem in qwt_painter_command.h

compiling C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_date.cpp
compiling C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_date_scale_draw.cpp
compiling C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_date_scale_engine.cpp
compiling C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_dyngrid_layout.cpp
compiling C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_event_pattern.cpp
compiling C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_graphic.cpp
In file included from C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_graphic.cpp:11:
C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_painter_command.h:85:22: error: field 'clipPath' has incomplete type 'QPainterPath'
   85 |         QPainterPath clipPath;
      |                      ^~~~~~~~

In file included from C:/msys64/mingw64/include/QtGui/qtransform.h:43,
                 from C:/msys64/mingw64/include/QtGui/qimage.h:48,
                 from C:/msys64/mingw64/include/QtGui/qpixmap.h:49,
                 from C:/msys64/mingw64/include/QtGui/qpainter.h:48,
                 from C:/msys64/mingw64/include/QtGui/qpaintengine.h:47,
                 from C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_null_paintdevice.h:15,
                 from C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_graphic.h:14,
                 from C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_graphic.cpp:10:
C:/msys64/mingw64/include/QtGui/qmatrix.h:54:7: note: forward declaration of 'class QPainterPath'
   54 | class QPainterPath;
      |       ^~~~~~~~~~~~
mingw32-make[5]: *** [Makefile:1271: qwt_graphic.o] Error 1
mingw32-make[5]: Leaving directory 'C:/msys64/home/admin/librepilot/build/librepilot-gcs_release/src/libs/qwt/src'
mingw32-make[4]: *** [Makefile:50: sub-src-make_first-ordered] Error 2
mingw32-make[4]: Leaving directory 'C:/msys64/home/admin/librepilot/build/librepilot-gcs_release/src/libs/qwt'
mingw32-make[3]: *** [Makefile:317: sub-qwt-make_first-ordered] Error 2
mingw32-make[3]: Leaving directory 'C:/msys64/home/admin/librepilot/build/librepilot-gcs_release/src/libs'
mingw32-make[2]: *** [Makefile:53: sub-libs-make_first-ordered] Error 2
mingw32-make[2]: Leaving directory 'C:/msys64/home/admin/librepilot/build/librepilot-gcs_release/src'
mingw32-make[1]: *** [Makefile:52: sub-src-make_first-ordered] Error 2
mingw32-make[1]: Leaving directory 'C:/msys64/home/admin/librepilot/build/librepilot-gcs_release'
mingw32-make: *** [Makefile:308: gcs] Error 2

andyp

  • *
  • 42
Re: Compiling Librepilot in Windows 10 - problems and solutions
« Reply #3 on: April 02, 2021, 12:31:10 am »
This has also something to do with python2 and 3, the library gtgui has got a different version

I need to download another lib with msys, but I don't know what library at the moment, need more time ;-)

andyp

  • *
  • 42
Re: Compiling Librepilot in Windows 10 - problems and solutions
« Reply #4 on: April 02, 2021, 01:04:57 am »
Everything has to do, that pacman is installing the newest packages.

Is there a way to install the toolchain from 2015?

andyp

  • *
  • 42
Re: Compiling Librepilot in Windows 10 - problems and solutions
« Reply #5 on: April 06, 2021, 11:15:02 pm »
In file included from C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_graphic.cpp:11:
C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/src/qwt_painter_command.h:85:22: error: field 'clipPath' has incomplete type 'QPainterPath'
   85 |         QPainterPath clipPath;
      |                      ^~~~~~~~

In file included from C:/msys64/mingw64/include/QtGui/qtransform.h:43,
                 from C:/msys64/mingw64/include/QtGui/qimage.h:48,
                 from C:/msys64/mingw64/include/QtGui/qpixmap.h:49,

You need to exchange qwt with the newest lib.

C:/msys64/home/admin/librepilot/ground/gcs/src/libs/qwt/*

replace with https://github.com/opencor/qwt at least version 6.1.5 (6.1.4 is not working)

It is running, see what problems occur now. ;-)