Cant init SDL library
this is the error
/tmp/ccchrNRk.o(.text+0x16): In function `main': : undefined reference to `SDL_Init' collect2: ld returned 1 exit status what does this mean here is the code that im using #include <SDL/SDL.h> #include <iostream> #include <vector> using namespace std; int main() { if(!SDL_Init(SDL_INIT_VIDEO)) { cout<<"error"<<endl; } return 0; } am i missing something or could i not have the library installed right. |
Sounds to me that the library wasn't linked in the binary during compilation. What CL did you use to compile it?
|
Well i just did this
g++ test.cpp how do i link at compile time |
You'll have to also include the library when compiling the code. I *think* it's
Code:
g++ test.cpp -lSDL Also, if it doesn't find 'SDL', try 'sdl' also. |
All times are GMT -5. The time now is 01:29 PM. |