Проблема с SDL

Модератор: Модераторы разделов

apacho
Сообщения: 110
ОС: MOPSLinux 5.1

Проблема с SDL

Сообщение apacho »

Короче взял из книги по SDL примерчик:

#include "SDL.h"
#include <stdio.h>

int main()
{
printf("Initializing SDL.\n");

if((SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO)==-1)) {
printf("Could not initialize SDL: %s.\n", SDL_GetError());
exit(-1);
}

printf("SDL initialized.\n");

printf("Quiting SDL.\n");

SDL_Quit();

printf("Quiting....\n");

return 0;
}

И при компиляции вылазит вот такая ошибка:
/usr/lib/libSDL.a(SDL_alsa_audio.o): In function `UnloadALSALibrary':
(.text+0x9a): undefined reference to `dlclose'
/usr/lib/libSDL.a(SDL_alsa_audio.o): In function `LoadALSALibrary':
(.text+0x10a): undefined reference to `dlopen'
/usr/lib/libSDL.a(SDL_alsa_audio.o): In function `LoadALSALibrary':
(.text+0x15b): undefined reference to `dlvsym'
/usr/lib/libSDL.a(SDL_alsa_audio.o): In function `LoadALSALibrary':
(.text+0x172): undefined reference to `dlsym'
/usr/lib/libSDL.a(SDL_x11gl.o): In function `X11_GL_UnloadLibrary':
(.text+0xfe): undefined reference to `dlclose'
/usr/lib/libSDL.a(SDL_x11gl.o): In function `X11_GL_LoadLibrary':
(.text+0x1a6): undefined reference to `dlopen'
/usr/lib/libSDL.a(SDL_x11gl.o): In function `X11_GL_LoadLibrary':
(.text+0x1ce): undefined reference to `dlsym'
/usr/lib/libSDL.a(SDL_x11gl.o): In function `X11_GL_LoadLibrary':
(.text+0x1e7): undefined reference to `dlsym'
/usr/lib/libSDL.a(SDL_x11gl.o): In function `X11_GL_LoadLibrary':
(.text+0x200): undefined reference to `dlsym'
/usr/lib/libSDL.a(SDL_x11gl.o): In function `X11_GL_LoadLibrary':
(.text+0x219): undefined reference to `dlsym'
/usr/lib/libSDL.a(SDL_x11gl.o): In function `X11_GL_LoadLibrary':
(.text+0x232): undefined reference to `dlsym'
/usr/lib/libSDL.a(SDL_x11gl.o):(.text+0x24b): more undefined references to `dlsym' follow
/usr/lib/libSDL.a(SDL_sysloadso.o): In function `SDL_LoadFunction':
(.text+0xb3): undefined reference to `dlerror'
/usr/lib/libSDL.a(SDL_sysloadso.o): In function `SDL_LoadObject':
(.text+0xfb): undefined reference to `dlopen'
/usr/lib/libSDL.a(SDL_sysloadso.o): In function `SDL_LoadObject':
(.text+0x102): undefined reference to `dlerror'
/usr/lib/libSDL.a(SDL_sysloadso.o): In function `SDL_UnloadObject':
(.text+0xc): undefined reference to `dlclose'
collect2: выполнение ld завершилось с кодом возврата 1

И что это такое?
Окошки не нужны, нужны ПИНГВИНЫ!!!
Слака рулит!!!!!!
Спасибо сказали:
Аватара пользователя
Portnov
Модератор
Сообщения: 1786
Статус: Матёрый линуксоид
ОС: Debian testing/unstable

Re: Проблема с SDL

Сообщение Portnov »

-ldl к опциям компилятора добавьте.
Работа: Ubuntu 9.10
Дом: Debian testing/unstable и на всякий случай winxp в virtualbox.
Для разнообразия: моя домашняя страница -http://iportnov.ru
Спасибо сказали: