Compiling and running GTK+ application on Windows 7

后端 未结 3 542
独厮守ぢ
独厮守ぢ 2020-12-10 00:05

System: Windows7, 32 bit, GTK 2.24.10, mingw
I am trying to write basic helloworld.c type GTK based application. However, it doesn\'t run.
These are the steps which

3条回答
  •  爱一瞬间的悲伤
    2020-12-10 00:40

    The error is right here.

    pkg-config is a utility which helps (and I strongly recommend) to determine link and lib flags. The issue you got is that gcc interprets it as a parameter if you pass them like you do - you need to exectue them in a subshell (but I have no clue how to do that under windows shell or cygwin) under bash it is either $(pkconfig --libs gtk-2.0) or with backticks around instead of $(...)

    D:\gtk>gcc -Wall -g helloworld.c -o helloworld pkg-config --cflags gtk+-2.0 pkg-config --libs gtk+-2.0
    gcc: pkg-config: No such file or directory
    gcc: gtk+-2.0: No such file or directory
    gcc: pkg-config: No such file or directory
    gcc: gtk+-2.0: No such file or directory
    cc1.exe: error: unrecognized command line option "-fcflags"
    cc1.exe: error: unrecognized command line option "-flibs"
    

提交回复
热议问题