User forums > Using Code::Blocks
search path problem
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?
--- End quote ---
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:
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 ( "`" )!
--- End quote ---
--- Quote from: jose on July 19, 2012, 07:56:19 pm ---pkg-config --cflags gtk+-2.0
--- End quote ---
What you posted does NOT have the back ticks? Why?
Tim S.
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
Navigation
[0] Message Index
[#] Next page
Go to full version