Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

if i try and compile the tutorial code for GTK3 with the command

gcc simple.c -o simple 'pkg-config --libs --cflags gtk+-3.0'

it gives off the error

gcc: error: pkg-config --libs --cflag gtk+-3.0: No such file or directory

However if i run the command

pkg-config --libs --cflag gtk+-3.0 > makefile

and then edit the makefile such that the output of the above command is after

gcc simple.c -o simple

then it compiles with no problems at all. What gives?

share|improve this question
add comment

1 Answer

I got this problem too, but after carefully see the the code, it just a typo. Please see again your command,

gcc simple.c -o simple 'pkg-config --libs --cflags gtk+-3.0'

It should be,

gcc simple.c -o simple `pkg-config --libs --cflags gtk+-3.0`

Can you see the different? The ' should be `. It works for me!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.