LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
Compiler/Makefile help


Hello,

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

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, 04:42 PM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
Include problems

Regarding

#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, 03:13 AM   #3
doxy
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?
Thk

Last edited by doxy; 03-14-2008 at 03:40 AM.
 
Old 03-14-2008, 03:10 PM   #4
cmnorton
Member
 
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.

#ifdef __MY_HEADER_FILE_INCLUDE__
#define __MY_HEADER_FILE_INCLUDE__

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

#endif /* __MY_HEADER_FILE_INCLUDE__ */
 
  


Reply


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, makefile.in and makefile.am Fond_of_Opensource Linux - Newbie 1 09-12-2006 09:35 PM
what is the meaning of Makefile,Makefile.am,Makefile.in cynthia_thomas Linux - General 3 12-08-2005 06:00 AM
how to get (makefile -f makefile )output into the textview widget in Pygtk sailu_mvn Programming 3 02-28-2005 04:57 AM
How must I edit a Makefile for another compiler??? Schmurff Fedora 3 09-28-2004 04:16 AM
generate Makefile from Makefile.in without calling ./configure ? chris78 Programming 2 05-02-2004 01:23 PM


All times are GMT -5. The time now is 08:36 AM.

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