SDL app funktioniert nicht unter Linux

Liebe Leute

Ich habe auf einem Ubunturechner SDL, SDL_TTF und SDL_Image installiert. Damit habe ich dann ein Programm geschrieben, das all diese Bibliotheken nutzt. Alles funktioniert einwandfrei.

Nun habe ich versucht, das Programm auf einem anderen Ubunturechner auszuführen (gleiche Version (neuste)). Das Programm startet nicht!
Das liegt wohl daran, dass die oben erwähnten Bibliotheken nicht auf dem zweiten Rechner installiert sind.

Für Windows muss man ja DLLs in den Programmordner schieben, damit das Programm starten kann.
Wie ist das bei Linux? Was muss ich machen, damit mein Programm auf allen Linux Rechnern funktioniert?

lg
Kalsan

Hallo Kalsan !

Anstatt auf den Rechnern auf denen das Programm laufen soll alle Bibliotheken extra zu installieren würde ich mal versuchen das Projekt static zu linken (Option ‚-static‘ beim gcc), vielleicht gehts so einfacher.

mfg
Christof

Hm, haut irgendwie nicht hin…
Nachdem ich -static zum Linker hinzugefügt habe, sind da plötzlich 50 Fehler.
Hier ein Auszug aus dem Build log von CodeBlocks:

Linking console executable: bin/Debug/Powerlines_1-1_LINUX
obj/Debug/main.o:frowning:.rodata+0x4fc): undefined reference to pthread\_cancel' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_CloseAudio’:
(.text+0x146): undefined reference to snd\_pcm\_drain' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_CloseAudio’:
(.text+0x156): undefined reference to snd\_pcm\_close' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_PlayAudio’:
(.text+0x1c4): undefined reference to snd\_pcm\_writei' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_PlayAudio’:
(.text+0x1e2): undefined reference to snd\_pcm\_prepare' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_PlayAudio’:
(.text+0x218): undefined reference to snd\_pcm\_resume' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x4e4): undefined reference to snd\_pcm\_open' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x4f1): undefined reference to snd\_pcm\_hw\_params\_sizeof' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x508): undefined reference to snd\_pcm\_hw\_params\_sizeof' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x530): undefined reference to snd\_pcm\_hw\_params\_any' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x557): undefined reference to snd\_pcm\_hw\_params\_set\_access' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x5a3): undefined reference to snd\_pcm\_hw\_params\_set\_channels' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x5d3): undefined reference to [snd\_pcm\_hw\_params\_set\_rate\_near@ALSA\_0.9](mailto:snd_pcm_hw_params_set_rate_near@ALSA_0.9)' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x607): undefined reference to [snd\_pcm\_hw\_params\_set\_period\_size\_near@ALSA\_0.9](mailto:snd_pcm_hw_params_set_period_size_near@ALSA_0.9)' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x637): undefined reference to [snd\_pcm\_hw\_params\_set\_periods\_near@ALSA\_0.9](mailto:snd_pcm_hw_params_set_periods_near@ALSA_0.9)' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x64e): undefined reference to snd\_pcm\_hw\_params' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x65b): undefined reference to snd\_pcm\_sw\_params\_sizeof' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x668): undefined reference to snd\_pcm\_sw\_params\_sizeof' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x697): undefined reference to snd\_pcm\_sw\_params\_current' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x6bb): undefined reference to snd\_pcm\_sw\_params\_set\_start\_threshold' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x6db): undefined reference to snd\_pcm\_sw\_params\_set\_avail\_min' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x6f7): undefined reference to snd\_pcm\_sw\_params' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x775): undefined reference to snd\_pcm\_nonblock' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x81e): undefined reference to snd\_pcm\_hw\_params\_set\_format' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x871): undefined reference to [snd\_pcm\_hw\_params\_get\_channels@ALSA\_0.9](mailto:snd_pcm_hw_params_get_channels@ALSA_0.9)' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x8bd): undefined reference to snd\_strerror' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x8e7): undefined reference to snd\_strerror' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x909): undefined reference to snd\_strerror' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x933): undefined reference to snd\_strerror' /usr/lib/libSDL.a(SDL\_alsa\_audio.o): In function ALSA_OpenAudio’:
(.text+0x95d): undefined reference to snd\_strerror' /usr/lib/libSDL.a(SDL\_alsa\_audio.o):frowning:.text+0x987): more undefined references to snd_strerror’ follow
/usr/lib/libSDL.a(SDL_alsa_audio.o): In function Audio\_Available': (.text+0xa91): undefined reference to snd_pcm_open’
/usr/lib/libSDL.a(SDL_alsa_audio.o): In function Audio\_Available': (.text+0xaa4): undefined reference to snd_pcm_close’
/usr/lib/libSDL.a(SDL_esdaudio.o): In function ESD\_CloseAudio': (.text+0x156): undefined reference to esd_close’
/usr/lib/libSDL.a(SDL_esdaudio.o): In function ESD\_OpenAudio': (.text+0x403): undefined reference to esd_play_stream’
/usr/lib/libSDL.a(SDL_esdaudio.o): In function Audio\_Available': (.text+0x4fe): undefined reference to esd_open_sound’
/usr/lib/libSDL.a(SDL_esdaudio.o): In function Audio\_Available': (.text+0x50e): undefined reference to esd_close’
/usr/lib/libSDL.a(SDL_pulseaudio.o): In function PULSE\_CloseAudio': (.text+0x14e): undefined reference to pa_simple_drain’
/usr/lib/libSDL.a(SDL_pulseaudio.o): In function PULSE\_CloseAudio': (.text+0x15e): undefined reference to pa_simple_free’
/usr/lib/libSDL.a(SDL_pulseaudio.o): In function PULSE\_PlayAudio': (.text+0x1ac): undefined reference to pa_simple_write’
/usr/lib/libSDL.a(SDL_pulseaudio.o): In function Audio\_Available': (.text+0x2c2): undefined reference to pa_simple_new’
/usr/lib/libSDL.a(SDL_pulseaudio.o): In function Audio\_Available': (.text+0x2d2): undefined reference to pa_simple_free’
/usr/lib/libSDL.a(SDL_pulseaudio.o): In function PULSE\_OpenAudio': (.text+0x3df): undefined reference to pa_channel_map_init_auto’
/usr/lib/libSDL.a(SDL_pulseaudio.o): In function PULSE\_OpenAudio': (.text+0x4e2): undefined reference to pa_simple_new’
/usr/lib/libSDL.a(SDL_nasaudio.o): In function NAS\_CloseAudio': (.text+0x146): undefined reference to AuCloseServer’
/usr/lib/libSDL.a(SDL_nasaudio.o): In function NAS\_WaitAudio': (.text+0x192): undefined reference to AuNextEvent’
/usr/lib/libSDL.a(SDL_nasaudio.o): In function NAS\_WaitAudio': (.text+0x1a6): undefined reference to AuDispatchEvent’
/usr/lib/libSDL.a(SDL_nasaudio.o): In function NAS\_PlayAudio': (.text+0x1f2): undefined reference to AuNextEvent’
/usr/lib/libSDL.a(SDL_nasaudio.o): In function NAS\_PlayAudio': (.text+0x206): undefined reference to AuDispatchEvent’
/usr/lib/libSDL.a(SDL_nasaudio.o): In function NAS\_PlayAudio': (.text+0x252): undefined reference to AuWriteElement’
/usr/lib/libSDL.a(SDL_nasaudio.o): In function Audio\_Available': (.text+0x2a6): undefined reference to AuOpenServer’
Process terminated with status 1 (0 minutes, 9 seconds)
50 errors, 677 warnings