News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

search path problem

Started by jose, July 19, 2012, 07:20:48 PM

Previous topic - Next topic

jose

 :)Hi
I have CodeBlocks width LINUX UBUNTU
after i install GTK pak , i try to compile a test code
firts problem:
compiler message <gtk/gtk.h> not found.
because CodeBlocks was looking in include directory but gtk/gtk.h is in
<include/gtk+-2.0/gtk/gtk.h>
i need to infor compiler about <gtk+-2.0> pak
i can do that with $pkg-config --cflags gtk+-2.0

if i type this command in console pkg-config --cflags gtk+-2.0
i get a list path in response.

then i make some modification on CodeBlocks compiler DialogBox
this is the old makro
$compiler $options $includes -c $file -o $object

the new one
$compiler $options $includes -c $file -o $object $pkg-config --cflags gtk+-2.0

also i try
$compiler $options $pkg-config --cflags gtk+-2.0 -c $file -o $object
in both cases i get this message
can you show me the way?

-------------- Build: Debug in gtkapi ---------------

Compiling: sound_test_c.cpp
g++: erro: gtk+-2.0: Ficheiro ou directoria inexistente //File not found
g++: erro: unrecognized option ‘-config’
g++: erro: unrecognized option ‘--cflags’
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

Thanks

Jenna

Quote from: jose on July 19, 2012, 07:20:48 PM
can you show me the way?

pkg-config is not a C::B macro and can not be used this way.

Just add `pkg-config --cflags gtk+-2.0` to the projects build options tab "Compiler settings -> Other options" and `pkg-config --libs gtk+-2.0` to "Linker settings -> Other linker options".
Note the backticks ( "`" )!

jose

#2
thanks for reply my friend
ok .
This is the look of my "Project/Build options/Compiler settings /other options" tab

-fexceptions
pkg-config --cflags gtk+-2.0

but i get the same error message

but if i type pkg-config --cflags gtk+-2.0 in console i get the list path of gtk pak
jose@jose-F3F:~$ pkg-config --cflags gtk+-2.0
-pthread -I/usr/include/gtk-2.0 -I/usr/lib/i386-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12

strange! I think the compiler expects the truck from the include directory, and I now see that these paths begin in user ???????

stahta01

Quote from: jens on July 19, 2012, 07:31:53 PM
Note the backticks ( "`" )!

Quote from: jose on July 19, 2012, 07:56:19 PM
pkg-config --cflags gtk+-2.0

What you posted does NOT have the back ticks? Why?

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

jose

 ;D
I forgot! hi! hi!

-fexceptions
'pkg-config --cflags gtk+-2.0'

Well, we already have something different, now I get this message that looks worse than the first


-------------- Build: Debug in gtkapi ---------------

Compiling: gtkApi.cpp
g++: erro fatal: no input files
compilação terminada.
Process terminated with status 4 (0 minutes, 0 seconds)
0 errors, 0 warnings





oBFusCATed

Why don't you use copy and paste? It would have saved you lots of time.

Now try to press the key on the left of '1' and above the 'tab'...
See the difference ` not ' ...

http://en.wikipedia.org/wiki/Grave_accent#Use_in_programming
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

jose

\pkg-config --cflags gtk+-2.0\

i think now is the one but no efect??

jose

`pkg-config --cflags gtk+-2.0`
i also try this one but itś the same

-------------- Build: Debug in gtkapi ---------------

Compiling: gtkApi.cpp
g++: erro fatal: no input files
compilação terminada.
Process terminated with status 4 (0 minutes, 0 seconds)
0 errors, 0 warnings


jose

I'm going crazy!
this time, compiled as before,
without the line pkg-config ...
and have something different!
this is what I get

-------------- Build: Debug in gtkapi ---------------

Compiling: gtkApi.cpp
In file included from / usr/include/glib-2.0/glib/galloca.h: 34:0,
                  from / usr/include/glib-2.0/glib.h: 32,
                  from / usr/include/glib-2.0/gobject/gbinding.h: 30,
                  from / usr/include/glib-2.0/glib-object.h: 25,
                  from / usr/include/glib-2.0/gio/gioenums.h: 30,
                  from / usr/include/glib-2.0/gio/giotypes.h: 30,
                  from / usr/include/glib-2.0/gio/gio.h: 28,
                  from / usr/include/gtk-2.0/gdk/gdkapplaunchcontext.h: 30,
                  from / usr/include/gtk-2.0/gdk/gdk.h: 32,
                  from / usr/include/gtk-2.0/gtk/gtk.h: 32,
                  from / home / jose / Documents / program / GTK / gtkapi / gtkApi.cpp: 7:
/ usr/include/glib-2.0/glib/gtypes.h: 34:24: Fatal error: glibconfig.h: File or directory does not exist
finished building.
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]