以前写过一个ubuntu下配置eclipse开发gtk的文章,原本觉得在windows下一样的方法应该没有问题,结果在make的时候却有了: html
g???cc: error: `pkg-config: No such file or directory
gcc: error: gtk+-2.0`: No such file or directory
gcc: error: unrecognized command line option '--cflags'
gcc: error: unrecognized command line option '--libs ubuntu
这种蛋疼的提示,我在以下网址找到了方法:http://www.360doc.com/content/14/0627/13/13881977_390243767.shtml windows
总的来讲是windows系统的命令行不能识别 ` 符号,解决方法就是设置环境变量,使此环境变量包含 pkg-config --cflags --libs gtk+-2.0 的输出 eclipse
可是原文最后好像出了一点错,因而个人作法是: spa
在环境变量中添加一个新的变量:GTK 命令行
内容就是pkg-config --cflags --libs gtk+-2.0 的输出,一个简单的编译包含gtk库的命令是: htm
gcc -o hello hello.c %GTK% ip