Author Topic: search path problem  (Read 11270 times)

Offline jose

  • Multiple posting newcomer
  • *
  • Posts: 15
search path problem
« 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
« Last Edit: July 19, 2012, 07:26:59 pm by jose »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: search path problem
« Reply #1 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 ( "`" )!

Offline jose

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: search path problem
« Reply #2 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 ???????
« Last Edit: July 19, 2012, 08:27:01 pm by jose »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: search path problem
« Reply #3 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.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline jose

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: search path problem
« Reply #4 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


 


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: search path problem
« Reply #5 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
(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!]

Offline jose

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: search path problem
« Reply #6 on: July 20, 2012, 12:28:30 am »
\pkg-config --cflags gtk+-2.0\

i think now is the one but no efect??

Offline jose

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: search path problem
« Reply #7 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
 

Offline jose

  • Multiple posting newcomer
  • *
  • Posts: 15
Re: search path problem
« Reply #8 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
(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!]