Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building Gpredict 2.x for Windows #110

Open
csete opened this issue Dec 29, 2017 · 10 comments
Open

Building Gpredict 2.x for Windows #110

csete opened this issue Dec 29, 2017 · 10 comments
Labels

Comments

@csete
Copy link
Owner

csete commented Dec 29, 2017

I am starting this new thread to track status and progress of windows builds, since the original pull request is now merged and closed.

Status as of writing:

  1. @phlash has updated the build files as well as some source files and can build a binary using mingw64 on Debian 9. He uses Gtk+/Glib binaries from Gnome project and these appear to be from 2012/2013. There is a test binary package on Phil's webiste for testing, but this has stability issues, which can be related to the age of the libraries. We need newer libraries.
  2. @gvanem has been building gpredict on windows using his own Makefile. This seems to support both MSYS2/MinGW and MSVC.
  3. I have installed MSYS2/MinGW64 on windows following the guidelines on the Gtk+ website. The default instructions set up a 64 bit development environment and I have managed to build a 64 bit binary package that runs stable and looks like the default Gnome 3 theme (see my comment below).
@csete
Copy link
Owner Author

csete commented Dec 29, 2017

I used the instruction on the Gtk+ website to setup MSYS2/MinGW. This has setup a more or less complete Unix environment and I could use the autotools method with a slightly modified configure.ac to build a binary.

The installation should also work using the updated Makefile as well as be able to build 32 bit binaries. I am going to try this next.


gpredict-win-main

gpredict-win-pref

@csete csete added the windows label Dec 29, 2017
@csete
Copy link
Owner Author

csete commented Dec 30, 2017

I continued with MSYS2/MinGW on windows and could install the 32 bit SDK along side the 64 bit SDK. I then copied the SDKs over to my Debian machine and could cross compile gpredict using the mingw-w64 cross compiler package.

So, using a standard MSYS2/MinGW installation we can build both 32 and 64 bit binaries on both windows and linux and using the latest Gtk+/Glib libraries.

I will now look into updating the runtime paths, icons, etc.

@csete
Copy link
Owner Author

csete commented Dec 30, 2017

Latest build, now using the new application icon (files no long available):

  • gpredict-win32-2.1.152.zip
  • gpredict-win64-2.1.152.zip

@phlash
Copy link
Contributor

phlash commented Dec 30, 2017

Looks like MSYS2 is the way to go for up to date libraries, glad that sorted out the stability issue :)

Removing the experimental binary...

I spent a little while looking at how MSYS2 obtains it's libraries, with a view to avoiding the Windows installation + copy to Linux for a cross-build. It uses the Arch package manager pacman, with all the appropriate packages pulled from repo.msys2.org. This looks like it could work on an alien system such as Debian, sadly there is no port of pacman outside Arch or MSYS2 available for Debian-based distros. I will continue with building pacman from source to complete the experiment however.

@phlash
Copy link
Contributor

phlash commented Dec 30, 2017

Experiment complete, it is possible to build pacman from source on Debian and use it to pull the appropriate MSYS2 i686/x86_64 dependencies for gpredict into local folders. I needed to re-compile the glib schemas (I suspect a native MSYS2 runs a post-fetch script for this):

cd /mingw32/share/glib-2.0/schemas/
/usr/lib/x86_64-linux-gnu/glib-2.0/glib-compile-schemas .

I also note that this approach appears to include a number of unnecessary libraries (eg: libpython2.7.so) that bloats the deployable ZIP by ~10M.

csete added a commit that referenced this issue Jan 2, 2018
csete added a commit that referenced this issue Jan 2, 2018
csete added a commit that referenced this issue Jan 2, 2018
@csete
Copy link
Owner Author

csete commented Jan 2, 2018

I think I have now fixed all remaining issues with the windows binary. As far as I can tell everything is working now.

gpredict-win32-2.1.156.zip

I think this is sufficient for the 2.2 release and we can improve the readme and the makefile as we go.

csete added a commit that referenced this issue Jan 3, 2018
@csete csete changed the title Gpredict 2.x for Windows Building Gpredict 2.x for Windows Jan 12, 2018
@srcejon
Copy link

srcejon commented Feb 13, 2020

I've just tried building git master for windows on msys2 using both mingw32 and mingw64 (x86_64) toolchains.

In order to get it to build & run on both, I needed to make a few changed to the Makefiles which are attached.

Main changes are:

  • including the png and jpeg loaders (jpeg seems to be needed for png to work - not sure why)
  • including the icons/Adwaita/scalable directory in the distribution
  • it no longer seems necessary to manually adjust pkg-config paths
  • update compiler flags to support both 32-bit and 64-bit builds

win32_build_patch.txt

@W3AXL
Copy link

W3AXL commented Jun 4, 2021

I've been trying to build the latest master on an MSYS2 install for my windows machine. I've configured the config.mk file to properly point to my /mingw64 folder, and it seems to be finding all the dependencies properly, but the build is still failing.

The last few lines I get when running the makefile are:

/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x26e): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x2f5): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x324): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x393): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x402): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x458): more undefined references to `g_ascii_strtod' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:227: libsgpsdp.dll] Error 1

Since I'm no pro C developer I can't just start digging into the files to figure out what's wrong. I'm guessing it's something simple in the toolchain that's just not configured right. However I followed all the instructions on the GTK windows setup page, and additionally had to keep installing various versions of the mingw gcc packages until I found the one that contained the correct i686-w64-mingw32-gcc command.

@Apace33
Copy link

Apace33 commented Aug 18, 2021

I've been trying to build the latest master on an MSYS2 install for my windows machine. I've configured the config.mk file to properly point to my /mingw64 folder, and it seems to be finding all the dependencies properly, but the build is still failing.

The last few lines I get when running the makefile are:

/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x26e): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x2f5): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x324): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x393): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x402): undefined reference to `g_ascii_strtod'
/opt/lib/gcc/i686-w64-mingw32/10.2.0/../../../../i686-w64-mingw32/bin/ld: sgp_in.o:sgp_in.c:(.text+0x458): more undefined references to `g_ascii_strtod' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:227: libsgpsdp.dll] Error 1

Since I'm no pro C developer I can't just start digging into the files to figure out what's wrong. I'm guessing it's something simple in the toolchain that's just not configured right. However I followed all the instructions on the GTK windows setup page, and additionally had to keep installing various versions of the mingw gcc packages until I found the one that contained the correct i686-w64-mingw32-gcc command.

Same issue here, do you happen to remember which package it was?

@curtiswilliams
Copy link

Anyone got a working windows build that’s somewhat up to date with the Linux version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants