Ubuntu 11.10: GCC/G++ won't link libraries

后端 未结 3 1025
执笔经年
执笔经年 2021-01-12 14:49

I went to compile a project of mine, which uses SDL, SDL_ttf, OpenAL, and GTK. All of which are outputting errors like the following:

TxtFunc.cpp:(.text+0x61         


        
3条回答
  •  时光说笑
    2021-01-12 14:59

    Generally you need to have your -l options after the files that use the symbols on the command line. Perhaps try moving the sdl-config --libs --cflags to the end of the command? i.e. for your test program:

    g++ -o sdl-test ./sdl-test.cpp `sdl-config --libs --cflags`
    

提交回复
热议问题