Defalt36 / TwoLifeXcompile

Files to assist with compilation of Two Hours One Life for Windows using an integrated Linux distribution. May also be used to compile other OneLife based games.
The Unlicense
1 stars 3 forks source link

Fatal error: SDL/SDL.h: No such file or directory #3

Closed NopeSniping closed 2 years ago

NopeSniping commented 2 years ago

I have tried many things, I have searched a lot on stackoverflow and askubuntu and other pages and I have tried everything they said, I can't find anything to fix this...

Building OneLife... /usr/bin/i686-w64-mingw32-g++ -Wall -Wwrite-strings -Wchar-subscripts -Wparentheses -g -DWIN_32 -DSTATICLIB -O0 -I../.. -c -o ../../minorGems/graphics/openGL/ScreenGL_SDL.o ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:145:10: fatal error: SDL/SDL.h: No such file or directory 145 | #include <SDL/SDL.h> | ^~~ compilation terminated. make: *** [Makefile:156: ../../minorGems/graphics/openGL/ScreenGL_SDL.o] Error 1 done compiling.

Building editor... /usr/bin/i686-w64-mingw32-g++ -static sdl-config --static-libs -Wall -Wwrite-strings -Wchar-subscripts -Wparentheses -g -DWIN_32 -DSTATICLIB -DUSE_PNG -O0 -I../.. -c -o ../../minorGems/graphics/openGL/ScreenGL_SDL.o ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:145:10: fatal error: SDL/SDL.h: No such file or directory 145 | #include <SDL/SDL.h>

Defalt36 commented 2 years ago

The SDL header is doesn't exist simply because you don't have SDL installed. Either install it with installMissingLibraries.sh or get it portable with getSDLforMingw.sh (Makefile.MinGWCross will not find the portable version as it only search installations now).

NopeSniping commented 2 years ago

Thats weird, I should have it. Not only because I checked that your "doEverything.sh" starts "installMissingLibraries.sh", but I have it in "\wsl$\Ubuntu-20.04\usr\include\SDL\SDL.h". And command "sdl-config --version" says I have version 1.2.15 installed. I remade all in my new pc with w11 too, and the same problem. Thanks for the quick response.

I only found a posible cause, "chances are your compiler is 32bit, which is why 64-bit SDL won't work". And its the only thing I dont know how to test. Could this be the problem? I am able to compile hetuw that requires SDL too.

Finally found how to this "get it portable with getSDLforMingw.sh (Makefile.MinGWCross will not find the portable version as it only search installations now)" and worked ;) Thank u. For me, problem fixed. Got another in editor, but I think I will not need it... I will leave it here anyways. minorGems/graphics/converters/PNGImageConverter.cpp:26:10: fatal error: png.h: No such file or directory 26 | #include

Defalt36 commented 2 years ago

Thats weird, I should have it. Not only because I checked that your "doEverything.sh" starts "installMissingLibraries.sh", but I have it in "\wsl$\Ubuntu-20.04\usr\include\SDL\SDL.h". And command "sdl-config --version" says I have version 1.2.15 installed.

Yes, you have it but this is the SDL installed in your system, or in another words Ubuntu's SDL. You are cross compiling so you need the libraries for windows and you need then installed in your compiler folder (MinGW). Aren't you over-sighting this? "Known Issues SDL won't install if it is in a folder with blank spaces in the path."

Got another in editor, but I think I will not need it... I will leave it here anyways. minorGems/graphics/converters/PNGImageConverter.cpp:26:10: fatal error: png.h: No such file or directory

This is yet another library missing in MinGW: LibPNG.

Defalt36 commented 2 years ago

Fixed: https://github.com/Defalt36/TwoLifeXcompile/commit/c7655205ebb4d4c2247bbb498d685f2ea096365b