| View previous topic :: View next topic |
| Author |
Message |
Neizan
Joined: 31 Oct 2007 Posts: 10
|
Posted: Fri Nov 02, 2007 9:41 pm Post subject: undefined reference to SDL_Init |
|
|
Hi,
I´m here again and I have another new problem.
I'm trying to use SDL libraries. My program looks like this:
| Code: | #include <pspkernel.h>
#include <SDL/SDL.h>
...
int main(int argc, char* argv[])
{
SetupCallbacks();
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
...
SDL_Quit();
sceKernelExitGame();
return 0;
}
... |
When I compile, I get the following error:
| Code: | main.cpp:(.text+0x144): referencia a `SDL_Init' sin definir
main.cpp:(.text+0x15c): referencia a `SDL_Quit' sin definir |
In English:
| Code: | main.cpp:(.text+0x144): undefined reference to `SDL_Init'
main.cpp:(.text+0x15c): undefined reference to `SDL_Quit' |
SDL.h looks like this:
| Code: | #ifndef _SDL_H
#define _SDL_H
#include "SDL_main.h"
#include "SDL_types.h"
#include "SDL_getenv.h"
#include "SDL_error.h"
#include "SDL_rwops.h"
#include "SDL_timer.h"
#include "SDL_audio.h"
#include "SDL_cdrom.h"
#include "SDL_joystick.h"
#include "SDL_events.h"
#include "SDL_video.h"
#include "SDL_byteorder.h"
#include "SDL_version.h"
#include "begin_code.h"
...
extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags);
...
extern DECLSPEC void SDLCALL SDL_Quit(void);
...
#include "close_code.h"
... |
SDL_Init and SDL_Quit are declared as extern functions, but I searched in every library included and they aren't defined there.
Any suggestion?
EDIT: I don't know so much about Makefile, may be I need to add some library there?
[code=Makefile]...
LIBS = -unknown_option
...[/code]
Sorry for my ignorance :S |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Sat Nov 03, 2007 5:18 am Post subject: |
|
|
SDL/README.PSP
| Quote: | Building applications
---------------------
Write your source file as you would a normal SDL program. Use the standard
Makefile as supplied with any PSPSDK sample program. Above the final "include"
line, add:
PSPBIN = $(PSPSDK)/../bin
CFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
LIBS += $(shell $(PSPBIN)/sdl-config --libs)
|
|
|
| Back to top |
|
 |
|