Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: jose on July 19, 2012, 07:20:48 pm

Title: search path problem
Post by: jose on July 19, 2012, 07:20:48 pm
 :)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
Title: Re: search path problem
Post by: Jenna on July 19, 2012, 07:31:53 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 ( "`" )!
Title: Re: search path problem
Post by: jose on July 19, 2012, 07:56:19 pm
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 ???????
Title: Re: search path problem
Post by: stahta01 on July 19, 2012, 08:46:12 pm
Note the backticks ( "`" )!

pkg-config --cflags gtk+-2.0

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

Tim S.
Title: Re: search path problem
Post by: jose on July 20, 2012, 12:00:07 am
 ;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


 

Title: Re: search path problem
Post by: oBFusCATed on July 20, 2012, 12:12:49 am
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
Title: Re: search path problem
Post by: jose on July 20, 2012, 12:28:30 am
\pkg-config --cflags gtk+-2.0\

i think now is the one but no efect??
Title: Re: search path problem
Post by: jose on July 20, 2012, 12:32:29 am
`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
 
Title: Re: search path problem
Post by: jose on July 20, 2012, 12:39:49 am
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
Title: Re: search path problem
Post by: oBFusCATed on July 20, 2012, 12:47:51 am
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F