Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
18
rated 0 times [  18] [ 0]  / answers: 1 / hits: 22788  / 2 Years ago, wed, april 20, 2022, 1:48:50

I've just upgraded from 11.4 to 11.10 and at least one thing seems to be broken: I have a C++ program that is using SDL and OpenGL. I was able to compile and run it just fine before the upgrade. Now I get linker errors, for example



undefined reference to `SDL_Init'


I have libsdl1.2debian and libsdl1.2-dev packages installed, I believe that is all I need (but I might be wrong). I compile the program like this:



gcc -I /usr/include/SDL -lSDL -o test test.cpp



Any idea what can be causing this?


More From » 11.10

 Answers
1

Ok, solved. Apparently, for some mysterious reason, the order of the gcc options now matters. So when I do:



gcc -I /usr/include/SDL -o test test.cpp -lSDL


(moved the -lSDL option to the end) everthing works just fine. I'd love to know why it suddenly matters, when before if did not, but for now I'm happy that stuff works again.


[#42813] Thursday, April 21, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
amencisiv

Total Points: 9
Total Questions: 102
Total Answers: 118

Location: Tajikistan
Member since Tue, Mar 21, 2023
1 Year ago
;