Closed NeverEndingCycle closed 4 years ago
fixed some MinGW stuff, and you try again and report back if it works now?
Now I am getting an error while linking:
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: CMakeFiles\fng2_srv.dir/objects.a(system.c.obj):system.c:(.text+0x1983): undefined reference to getaddrinfo' c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: CMakeFiles\fng2_srv.dir/objects.a(system.c.obj):system.c:(.text+0x19b3): undefined reference to freeaddrinfo' collect2.exe: error: ld returned 1 exit status CMakeFiles\fng2_srv.dir\build.make:519: recipe for target 'fng2_srv.exe' failed mingw32-make[2]: *** [fng2_srv.exe] Error 1 CMakeFiles\Makefile2:365: recipe for target 'CMakeFiles/fng2_srv.dir/all' failed mingw32-make[1]: *** [CMakeFiles/fng2_srv.dir/all] Error 2 Makefile:169: recipe for target 'all' failed mingw32-make: *** [all] Error 2
mhh mingw32 is really strange, you can try: https://sourceforge.net/projects/mingw-w64/
cross compiling with mingw under linux works
or if you want more linux like toolchain: https://www.msys2.org/ it has mingw64 support too
seems like mingw64 is broken rn, get an internal compiler error on linux and with the mingw(over MSys2) setup pacman -S mingw-w64-x86_64-gcc pacman -S mingw-w64-x86_64-SDL2 pacman -S mingw-w64-x86_64-freetype pacman -S mingw-w64-x86_64-cmake pacman -S mingw-w64-x86_64-make
cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1 make -j20 worked except the compilation error, on linux 32 bit works rn so probs on windows too, hope that help for 32 bit testing you have to replace x86_64 with i686 in the package names
also you have to start as mingw path C:\msys64\mingw32{64}.exe
I downloaded mysys2 and downloaded all of the dependencies following your steps but I have a few problems.
For this command: cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1
I don't have cygwin installed. Do I need it? I get this warning when building without it: Manually-specified variables were not used by the project: CMAKE_LEGACY_CYGWIN_WIN32
The cmake command also appears to be building the project with VS Studio instead of MinGW. How do I get around this?
Even after running pacman -S mingw-w64-x86_64-make
when I type make -j20
it tells me -bash: make: command not found.
Am I supposed to add something to path?
yes thats ok
you have to change your path variables so mingw/cmake/make is found before vs(or uninstall vs), other cmake or other make(maybe installed by VS)
ok maybe u have to type mingw-w64-x86_64-make instead of make
Alright, I've managed to get it working with some workarounds!
Moving the environment variable didn't do anything, but I was able to choose the generator by adding -G "MSYS Makefiles
as an argument to the cmake command. (I also removed -DCMAKE_LEGACY_CYGWIN_WIN32=1
because it was unused.)
mingw-w64-x86_64-make
didn't work, but I was able to get the original make
command working by running pacman -S make
instead.
After re-running everything compiled correctly (with a few warnings). Thanks again!
But good to hear :D
Alright, good to know.
I'm getting this error all over when compiling with MinGW and CMake on windows. Any ideas?