Compiling and Linking GTK 3 with C project on Ubuntu

前端 未结 2 1628
耶瑟儿~
耶瑟儿~ 2021-02-07 04:18

I believe this is not a duplicate question, I have seen all questions/answers before I post this question. I think I have a different situation here.

I use Ubuntu 12.04

2条回答
  •  你的背包
    2021-02-07 05:03

    You should compile with source file appearing before the libraries as gcc hello.c $(pkg-config --cflags --libs gtk+-3.0) -o hello, the reason being the behavior of linker i.e it does not link the libraries unless the symbols of that library is seen prior in compilation.
    Hope this helps!

提交回复
热议问题