
janunesdemor
(usa Slackware)
Enviado em 01/08/2009 - 17:58h
janunesdemor
(usa Slackware) [1] Enviado em 01/08/2009 - 17:15h:
SDL erro ao compliar C/C++
Prezado colegas,
Estou tendo o seguinte problema ao tenta compliar e linkar este exemplo:
# cat exemplo.c
#include <SDL/SDL.h>
#include <stdio.h>
int main()
{
printf("Iniciando SDL...\n");
if ( SDL_Init(SDL_INIT_VIDEO) == -1) {
printf("Impossível iniciar SDL.. %s\n", GetError());
exit(-1);
}
printf("SDL iniciado...\n");
printf("Fechando SDL...\n");
SDL_Quit();
printf("Fechando o aplicativo...\n");
exit(0);
}
Ao compilar e linkar da este erro:
# gcc som.c -o som
som.c:9:2: warning: no newline at end of file
/tmp/ccqQ1f6m.o: In function `main':
som.c:(.text+0x17): undefined reference to `SDL_Init'
som.c:(.text+0x30): undefined reference to `Mix_OpenAudio'
som.c:(.text+0x38): undefined reference to `Mix_CloseAudio'
som.c:(.text+0x3d): undefined reference to `SDL_Quit'
collect2: ld returned 1 exit status