Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-13-2008, 01:24 PM   #1
LQ Newbie
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
Compiler/Makefile help


Im writing a gui and I have to use some libs a guy wrote. My directory structure is:

In ui folder there are ui files created with Qt Designer but I have 2 questions about compiler/makefile:
1) If I include file with #include <libs/HeaderExample.h> compiler says it can't find it
2) If i put complete path into #include it gives other errors (I think because they are not compiled)

Can some1 links or explain me how does it work?
Thank you very much
Old 03-13-2008, 03:42 PM   #2
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Include problems


#include <libs/HeaderExample.h>

you're going to need to do one of two things.

Modify C_INCLUDE_PATH to include the path to the parent directory of libs, or pass the same (parent directory of libs) into gcc using the -I switch.
Old 03-14-2008, 02:13 AM   #3
LQ Newbie
Registered: Mar 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thk a lot cmnorton! Its a great help
I did it and now it doesn't give that error for missing file But now it gives me a lot of errors when it tries to include that file :S
Libs are compiled into libs/ with Makefile file but how can I tell him that header files it includes are already compiled and how to link them with gui files?

Last edited by doxy; 03-14-2008 at 02:40 AM.
Old 03-14-2008, 02:10 PM   #4
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
use include directives

Based on what you have said without any actual error messages, it sounds like you need to protect against multiple includes of the same header file, which is almost impossible to prevent.


<... body of include file ...>

#endif /* __MY_HEADER_FILE_INCLUDE__ */


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
automake, makefile, and Fond_of_Opensource Linux - Newbie 1 09-12-2006 08:35 PM
what is the meaning of Makefile,, cynthia_thomas Linux - General 3 12-08-2005 05:00 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 03:57 AM
How must I edit a Makefile for another compiler??? Schmurff Fedora 3 09-28-2004 03:16 AM
generate Makefile from without calling ./configure ? chris78 Programming 2 05-02-2004 12:23 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration