Functions with very similar names are in library libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2.0 in package libsdl2-2.0-0.
For examlpe, SDL_RenderCopy but not Renderer, SDL_CreateRGBSurfaceFrom. Check your source.
Peter.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[C++] SDL2 - Undefined references to functions at school
-
- Posts: 1405
- Joined: 2009-09-10 20:15
- Location: Saint-Petersburg, Russian Federation
- Been thanked: 11 times
Re: [C++] SDL2 - Undefined references to functions at school
Last edited by peter_irich on 2017-02-12 19:53, edited 1 time in total.
Re: [C++] SDL2 - Undefined references to functions at school
What is the output of:commodorejohn wrote:I really don't understand why this is happening. Any advice on resolving this issue?Code: Select all
commodorejohn@devuan:~$ gcc sdltest.c `sdl2-config --cflags --libs` -o sdltest /tmp/ccCtWq9W.o: In function `main': sdltest.c:(.text+0x15f): undefined reference to `SDL_CreateRGBSurfaceWithFormat' sdltest.c:(.text+0x2c2): undefined reference to `SDL_RendererFillRect' sdltest.c:(.text+0x326): undefined reference to `SDL_RendererCopy' sdltest.c:(.text+0x341): undefined reference to `SDL_RendererPresent' collect2: error: ld returned 1 exit status
Code: Select all
sdl2-config --cflags --libs
ASRock H77 Pro4-M i7 3770K - 32GB RAM - Pioneer BDR-209D
-
- Posts: 35
- Joined: 2011-06-29 10:26
Re: [C++] SDL2 - Undefined references to functions at school
Thank you, well-spotted. The "render"/"renderer" typo was the bulk of it, and the other problem was that I was going off the SDL wiki without noticing that SDL_CreateRGBSurfaceWithFormat wasn't added until 2.0.5. It builds and runs without issue now.peter_irich wrote:Functions with very similar names are in library libSDL2-2.0.so.0 -> libSDL2-2.0.so.0.2.0 in package libsdl2-2.0-0.
For examlpe, SDL_RenderCopy but not Renderer, SDL_CreateRGBSurfaceFrom. Check your source.