Jupeyy / teeworlds-fng2-mod

FNG mod for teeworlds, that advances the original FNG idea by golden spikes and other features
Other
19 stars 27 forks source link

error: 'int64_t' was not declared in this scope; did you mean 'int64'? 15 | extern int CountBits(int64_t Flag); #9

Closed NeverEndingCycle closed 4 years ago

NeverEndingCycle commented 4 years ago

I'm getting this error all over when compiling with MinGW and CMake on windows. Any ideas?

Jupeyy commented 4 years ago

fixed some MinGW stuff, and you try again and report back if it works now?

NeverEndingCycle commented 4 years ago

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

Jupeyy commented 4 years ago

mhh mingw32 is really strange, you can try: https://sourceforge.net/projects/mingw-w64/

cross compiling with mingw under linux works

Jupeyy commented 4 years ago

https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe thats the installer

Jupeyy commented 4 years ago

or if you want more linux like toolchain: https://www.msys2.org/ it has mingw64 support too

Jupeyy commented 4 years ago

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

NeverEndingCycle commented 4 years ago

I downloaded mysys2 and downloaded all of the dependencies following your steps but I have a few problems.

  1. 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

  2. The cmake command also appears to be building the project with VS Studio instead of MinGW. How do I get around this?

  3. 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?

Jupeyy commented 4 years ago
  1. yes thats ok

  2. 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)

  3. ok maybe u have to type mingw-w64-x86_64-make instead of make

NeverEndingCycle commented 4 years ago

Alright, I've managed to get it working with some workarounds!

  1. 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.)

  2. 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.

  3. After re-running everything compiled correctly (with a few warnings). Thanks again!

Jupeyy commented 4 years ago
  1. it should only be unused when u didnt clean your build directory before

But good to hear :D

NeverEndingCycle commented 4 years ago

Alright, good to know.