Results 1 to 1 of 1
hi,
I would like to get sdl to work in kdevelop but when i open a new project as c++ simple sdl program
and try to compile it I get ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-08-2006 #1
SDL in kdevelop compile error
hi,
I would like to get sdl to work in kdevelop but when i open a new project as c++ simple sdl program
and try to compile it I get these compile errors.
cd "/home/smith/sdl/debug/src" && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" gmake -k sdl
*/home/smith/sdl/src/sdl.cpp:35: undefined reference to `SDL_Init'
*/home/smith/tmp/ccdeC3Ie.o(.text+0x59):/home/smith/sdl/src/sdl.cpp:36: undefined reference to `SDL_GetError'
*/home/smith/tmp/ccdeC3Ie.o(.text+0x89):/home/smith/sdl/src/sdl.cpp:37: undefined reference to `SDL_Quit'
*/home/smith/tmp/ccdeC3Ie.o(.text+0xc7):/home/smith/sdl/src/sdl.cpp:41: undefined reference to `SDL_CDNumDrives'
*/home/smith/tmp/ccdeC3Ie.o(.text+0xfe):/home/smith/sdl/src/sdl.cpp:42: undefined reference to `SDL_CDNumDrives'
*/home/smith/tmp/ccdeC3Ie.o(.text+0x11b):/home/smith/sdl/src/sdl.cpp:43: undefined reference to `SDL_CDName'
*/home/smith/tmp/ccdeC3Ie.o(.text+0x172):/home/smith/sdl/src/sdl.cpp:46: undefined reference to `SDL_Quit'
**** Exited with status: 2 ***
I tried to compile it without kdevelop but the same thing happend.
here is the code for the file I am trying to compile
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <iostream>
#include <stdlib.h>
#include <SDL/SDL.h>
using namespace std;
int main(int argc, char *argv[])
{
cout <<"Initializing SDL." << endl;
/* Initializes Audio and the CDROM, add SDL_INIT_VIDEO for Video */
if(SDL_Init(SDL_INIT_AUDIO | SDL_INIT_CDROM)< 0) {
cout <<"Could not initialize SDL:" << SDL_GetError() << endl;
SDL_Quit();
} else {
cout << "Audio & CDROM initialized correctly" << endl;;
/* Trying to read number of CD devices on system */
cout << "Drives available :" << SDL_CDNumDrives() << endl;
for(int i=0; i < SDL_CDNumDrives(); ++i) {
cout << "Drive " << i << "\"" << SDL_CDName(i) << "\"";
}
}
SDL_Quit();
}
I do have all the include files but i still cant get it to work.
can sombody please help me? Thank you all very much.


Reply With Quote
