I'm getting "
undefined reference to `SDL_Init'" when I try to run
Code:
#include <iostream>
#include <SDL/SDL.h>
int main(int argc, char **argv) {
SDL_Init(SDL_INIT_VIDEO);
std::cout << "SDL is running" << std::endl;
SDL_SetVideoMode(720,480,32,SDL_SWSURFACE);
SDL_Init(SDL_INIT_TIMER);
SDL_Delay(2000);
SDL_Quit();
return 0;
}
I know this has something to do with linkers and libraries, I've also searched around a lot but none of the solutions are up to date.
For example:
KDevelop & SDL
Quote:
Originally Posted by Relja
I don't know about the documentation, but my SDL program works fine with KDevelop.
All I needed to put is:
Project->Project Options->Configure Options:
C/C++ preprocessor flags (CPPFLAGS):
`sdl-config --cflags`
Linker flags (LDFLAGS):
`sdl-config --libs`
and in
Automake Manager->Options:
Compiler flags for C__ compiler (CXXFLAGS):
`sdl-config --cflags --libs`
And it works ok...
|
Problem is that this solution is out dated. 'Project Options' and 'Automake Manager' do not exist, or if they're just well hidden in KDevelop 4.2.
How do I setup a SDL-project in KDevelop 4?
