PDA

View Full Version : How to config Kdevelop for GTK+


gkk
15th October 2008, 02:13 PM
I'd like to build a basic gtk program with Kdevelop, but I can not compile it.

I've used this two configuration with the same result:

1)
LDFLAGS="pkg-config --cflags --libs gtk+-2.0"
CPPFLAGS="pkg-config --cflags --libs gtk+-2.0"

2)
LDFLAGS="pkg-config --libs gtkmm-2.4"
CPPFLAGS="pkg-config --cflags gtkmm-2.4"

I can compile the program from the command line with the first one, but I can not do it from kdevelop.

********************
The output is:

"configure: error: C++ compiler cannot create executables
See `config.log' for more details."

*******************
In the log file I've found this:

1)First case:
g++: pkg-config: No such file or directory
g++: gtk+-2.0: No such file or directory
g++: pkg-config: No such file or directory
g++: gtk+-2.0: No such file or directory
cc1plus: error: unrecognized command line option "-fcflags"
cc1plus: error: unrecognized command line option "-flibs"
cc1plus: error: unrecognized command line option "-fcflags"
cc1plus: error: unrecognized command line option "-flibs"

2)Second case:
g++: pkg-config: No such file or directory
g++: gtkmm-2.4: No such file or directory
g++: pkg-config: No such file or directory
g++: gtkmm-2.4: No such file or directory
cc1plus: error: unrecognized command line option "-fcflags"
cc1plus: error: unrecognized command line option "-flibs"

************************************************** ***

I hope somebody may help me with this problem. :confused:

sideways
15th October 2008, 05:12 PM
does using the full path /usr/bin/pkg-config help?

maybe try cutting and pasting the actual output of the command (ie type 'pkg-config --cflags --libs gtk+-2.0' in a terminal and cut and paste the output into CPPFLAGS and LDFLAGS)

gkk
15th October 2008, 10:34 PM

First option (using full path /usr/bin/pkg-config) does not work either.

Second option works fine, thanks

This solves the problem: "cutting and pasting the actual output of the command ('pkg-config') into CPPFLAGS and LDFLAGS)"

jonduf
21st October 2008, 03:17 PM
You should probably enclose your pkg-config command with a `

This is the character in the top left of most keyboards on the same key as the ~

Do not confuse this with a quote or apostraphe. In a shell this causes the command inside ` to be executed and replaced by the output of the command.

So change the line from

LDFLAGS="pkg-config --cflags --libs gtk+-2.0"

to

LDFLAGS="`pkg-config --cflags --libs gtk+-2.0`"

gkk
22nd October 2008, 01:33 PM
Thanks jonduf, you are right, that was the problem, y should have enclosed the command with `. Now it is working fine.