Yritän saada toimimaan SDL:ää ja OpenGl:ää, ja vaikeuksien jälkeen kaikki "normaalit" hommat löytyivät. Nyt tuli seuraavanlainen ongelma, g++ antaa:
kray@asakaze:~/programming/fly$ ./make.sh
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_systhread.o): In function `SDL_SYS_WaitThread':
(.text+0x38): undefined reference to `pthread_join'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_systhread.o): In function `SDL_SYS_SetupThread':
(.text+0x9e): undefined reference to `pthread_sigmask'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_systhread.o): In function `SDL_SYS_CreateThread':
(.text+0x116): undefined reference to `pthread_create'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_systhread.o): In function `SDL_SYS_KillThread':
(.text+0xe): undefined reference to `pthread_cancel'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_syssem.o): In function `SDL_SemPost':
(.text+0x12): undefined reference to `sem_post'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_syssem.o): In function `SDL_SemValue':
(.text+0x6f): undefined reference to `sem_getvalue'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_syssem.o): In function `SDL_SemWait':
(.text+0xa4): undefined reference to `sem_wait'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_syssem.o): In function `SDL_SemTryWait':
(.text+0x101): undefined reference to `sem_trywait'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_syssem.o): In function `SDL_DestroySemaphore':
(.text+0x1d2): undefined reference to `sem_destroy'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_syssem.o): In function `SDL_CreateSemaphore':
(.text+0x21c): undefined reference to `sem_init'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_sysmutex.o): In function `SDL_CreateMutex':
(.text+0x104): undefined reference to `pthread_mutexattr_init'
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libSDL.a(SDL_sysmutex.o): In function `SDL_CreateMutex':
(.text+0x114): undefined reference to `pthread_mutexattr_settype'
collect2: ld returned 1 exit status
Mikäs mahtaisi olla pielessä? Make.sh:
g++ main.cpp -o fly -lSDL -lSDLmain -lGL -lGLU
Edit: Sain toimimaan lisäämällä Linkkerille -lpthread