ptitSeb / stuntcarremake

A port of Stunt Car Remake to OpenPandora, Linux and Emscripten. Status: Working
http://ptitseb.github.io/stuntcarremake/
Other
71 stars 11 forks source link

Trying to build a simple GN/Linux+SDL2 version #15

Closed vanfanel closed 3 years ago

vanfanel commented 3 years ago

Hi @ptitSeb

I am trying to build a simple GNU/Linux+SDL2 version of Stunt Car Remake usging the code in this repo.

For this, I added these to the Makefile (else it tried to build against SDL1....):


FLAGS+= -Dlinux -DUSE_SDL2
LDFLAGS= -s FULL_ES2=1 -s USE_SDL_TTF=2 -s USE_SDL=2

However I still get:

/usr/bin/ld: StuntCarRacer.o: in function `CreateFonts()':
/home/manuel/src/stuntcarremake/StuntCarRacer.cpp:605: undefined reference to `TTF_WasInit'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:605: undefined reference to `TTF_Init'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:606: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:612: undefined reference to `TTF_OpenFont'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:616: undefined reference to `TTF_OpenFont'
/usr/bin/ld: StuntCarRacer.o: in function `process_events()':
/home/manuel/src/stuntcarremake/StuntCarRacer.cpp:1803: undefined reference to `SDL_PollEvent'
/usr/bin/ld: StuntCarRacer.o: in function `main':
/home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2026: undefined reference to `SDL_Init'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2037: undefined reference to `SDL_Quit'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2039: undefined reference to `TTF_Init'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2067: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2068: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2069: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2070: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2071: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2148: undefined reference to `SDL_CreateWindow'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2160: undefined reference to `SDL_GL_CreateContext'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2165: undefined reference to `SDL_GetWindowSize'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2166: undefined reference to `SDL_SetWindowTitle'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2175: undefined reference to `SDL_CreateRGBSurfaceWithFormatFrom'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2181: undefined reference to `SDL_SetWindowIcon'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2182: undefined reference to `SDL_FreeSurface'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2285: undefined reference to `SDL_GL_SwapWindow'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2293: undefined reference to `SDL_Delay'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2301: undefined reference to `TTF_Quit'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2302: undefined reference to `SDL_Quit'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2027: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2067: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2068: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2069: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2070: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2071: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: StuntCarRacer.o:/home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2089: more undefined references to `SDL_GL_SetAttribute' follow
/usr/bin/ld: StuntCarRacer.o: in function `main':
/home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2157: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2162: undefined reference to `SDL_GetError'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2229: undefined reference to `SDL_ShowCursor'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2152: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2153: undefined reference to `SDL_GL_SetAttribute'
/usr/bin/ld: /home/manuel/src/stuntcarremake/StuntCarRacer.cpp:2154: undefined reference to `SDL_CreateWindow'
/usr/bin/ld: sound_openal.o: in function `sound_load(void*, int, int, int, int, int)':
/home/manuel/src/stuntcarremake/sound_openal.cpp:414: undefined reference to `SDL_FreeWAV'
/usr/bin/ld: dx_linux.o: in function `CDXUTTextHelper::CDXUTTextHelper(_TTF_Font*, unsigned int, int)':
/home/manuel/src/stuntcarremake/dx_linux.cpp:831: undefined reference to `TTF_FontHeight'
/usr/bin/ld: /home/manuel/src/stuntcarremake/dx_linux.cpp:851: undefined reference to `SDL_FreeSurface'
/usr/bin/ld: /home/manuel/src/stuntcarremake/dx_linux.cpp:847: undefined reference to `TTF_RenderText_Blended'
/usr/bin/ld: dx_linux.o: in function `DXUTGetTime()':
/home/manuel/src/stuntcarremake/dx_linux.cpp:945: undefined reference to `SDL_GetTicks'
collect2: error: ld returned 1 exit status
make: *** [Makefile:167: stuntcarracer] Error 1

I am missing some small piece here, but... what?

Thanks!

ptitSeb commented 3 years ago

Yes, don't change the Makefile; just use make LINUX=1 SDL=2 as indicated in the readme.

vanfanel commented 3 years ago

@ptitSeb Great! That did it! :) Thanks a lot! What a fun game this is... I will try to run it on the Pi next, now that I got X-less OpenGL to work there (no gl4es needed!)

vanfanel commented 3 years ago

Closing this, thanks for your support and of course your awesome work on this!