Author Topic: can't find include files  (Read 1678 times)

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
can't find include files
« on: June 05, 2011, 02:12:25 PM »
Hi guys,
I have some compiling problem :/
Several apps I'm trying to make can't find include files, but that include files exist in /usr/include/
It's gnome3 packages.
Also maybe i should mention that my hostname is not localhost [me@localhost]

I noticed when i changed hostname that path was missing some dirs like /usr/sbin, etc...
I added /usr/include to PATH, but no avail.

Can anyone help me?



Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3881
Re: can't find include files
« Reply #1 on: June 05, 2011, 06:04:13 PM »
It will be very difficult to guess what is happening without more details. When you are compiling what include files are missing and what error do you receive?

Galen

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6266
Re: can't find include files
« Reply #2 on: June 05, 2011, 07:04:39 PM »

The "PATH" variable contains paths to binary programs only, not include header files or anything else.

It will be a lot easier if you could post what error message you are getting when things fail.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: can't find include files
« Reply #3 on: June 06, 2011, 11:19:31 AM »
Ok thanks for replies :)
I can't copy from the terminal, but here are the screenshots:
http://imgur.com/a/KtkvK

This is when i tried to build brasero and mutter.
The files it reports missing are in their dirs in /usr/include... Packages depended on gtk-devel and totem-pl-parser-devel which are installed.

I don't know why is this happening, but thank you for your efforts :)



Offline muungwana

  • Hero Member
  • *****
  • Posts: 6266
Re: can't find include files
« Reply #4 on: June 06, 2011, 12:49:19 PM »

open "brasero-io.c" text file and then go to line 50 and you should see something like:

include <totel-pl-parser.h>

change the line to:

include </usr/include/totem-pl-perser.h>

if "totem-pl-perser.h" is actually at "/usr/include> and then try to compile again
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3881
Re: can't find include files
« Reply #5 on: June 06, 2011, 12:57:40 PM »
If you are looking to create an srpm, then you problem want to set the correct path without editing the source. I know that building qt programs occasionally need a variable set to get the right version of things.

./configure QTDIR=/usr/lib/qt3

For qt, this will prevent the build process from using tools and libraries from qt2 or qt4. I don't know if something like this is require for gtk programs.

Galen

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: can't find include files [SOLVED]
« Reply #6 on: June 07, 2011, 07:22:18 AM »
I've solved it, but it's not supposed to be that way... :/
Include files were in subdirectories that's why it didn't compile...

it looked for /gtk/gtk.h so the path should be /usr/include/gtk/gtk.h instead it was /usr/include/gtk-3.0/gtk/gtk.h

And i don't believe that's how include files are supposed to work :D
Files should be installed where apps are searching for them when you install -devel package.

Thanks anyway :)



Offline Texstar

  • Administrator
  • Super Villain
  • *****
  • Posts: 12657
Re: can't find include files [SOLVED]
« Reply #7 on: June 07, 2011, 07:30:35 AM »
I've solved it, but it's not supposed to be that way... :/
Include files were in subdirectories that's why it didn't compile...

it looked for /gtk/gtk.h so the path should be /usr/include/gtk/gtk.h instead it was /usr/include/gtk-3.0/gtk/gtk.h

And i don't believe that's how include files are supposed to work :D
Files should be installed where apps are searching for them when you install -devel package.

Thanks anyway :)

Not all programs look for include files in the same place. That is why you have to add export CPPFLAGS="$CPPFLAGS -I/usr/include/gtk-3.0/gtk" so hopefully the program can then find it. Sometimes that doesn't work and you have to temporary symlink include files to the /usr/include folder so the program building can find them.


Thanks to everyone who donates. You keep the servers running.
Follow me on Twitter for the latest development info.

Offline slax

  • Sr. Member
  • ****
  • Posts: 391
    • PCLinuxOS Gnome Edition
Re: can't find include files
« Reply #8 on: June 07, 2011, 11:40:44 AM »
Ok thanks, i wasn't aware of that :/ since hadn't had problems 'till now...

I thought maybe devs would use some standards :|
;)

regards



Offline muungwana

  • Hero Member
  • *****
  • Posts: 6266
Re: can't find include files
« Reply #9 on: June 07, 2011, 11:54:28 AM »

I've solved it, but it's not supposed to be that way... :/
Include files were in subdirectories that's why it didn't compile...

it looked for /gtk/gtk.h so the path should be /usr/include/gtk/gtk.h instead it was /usr/include/gtk-3.0/gtk/gtk.h

And i don't believe that's how include files are supposed to work :D
Files should be installed where apps are searching for them when you install -devel package.

Thanks anyway :)
I assume gtk2 and gtk3 are different enought.
How can include files from both tool kits coexist in the same system if they both want to use "/usr/include/gtk/gtk.h"?

It seem most appropriate to me to have gtk3 in a different folder since gtk2 is still around is still most widely used.

"standard" include folders are "/usr/include" and at times "/usr/local/include". As long as they are in there, then they are where they are supposed to be and if the program you want to build is looking in these folders but in different subfolders, then you have to do what texstar said, create symbolic links to them, export CPPFLAGS with the path to the new subfolder or modify the include path in the source file.
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..