compiling on cygwin



Pieter Engelen writes:
gcc `pkg-config --libs gtk+-2.0` -Wall -g hello.c -o hello
`pkg-config--cflags gtk+-2.0`

What is wrong?

(I assume the missing space in front of --cflags was a typo?)  Switch
the cflags and libs. It's also customary to name the output file
before the object (or source) files. I.e.:

gcc -o hello `pkg-config --cflags gtk+-2.0` -Wall -g hello.c `pkg-config --libs gtk+-2.0`

BTW, I hope you aren't using the prebuilt Win32 GTK DLLs from
www.gimp.org/win32/ when building a Cygwin application? That's not
supported, and will cause trouble sooner or later once you move on
from hello world to a real application. For Cygwin, use GLib and GTK
built for Cygwin. (No, I don't know where to find fresh binaries.)

--tml





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]