🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.os.linux.ubuntu
Article #116

Re: where to put custom headers

#116
From: Yann Renard
Date: Wed, 20 Jan 2010 17:26
51 lines
3043 bytes
frank wrote:
> I'm replicating a program provided by Richard Heathfield in _C 
> Unleashed_.  The custom header for this project is in the same directory 
> as the source:
> 
> dan@dan-desktop:~/source/unleashed/ch11$ ls -l
> 
> -rw-r--r-- 1 dan dan  1612 2000-06-08 16:13 strarr.h
> 
> dan@dan-desktop:~/source/unleashed/ch11$
> 
> When I compile with -v, this is what I see:
> 
> #include "..." search starts here:
> #include <...> search starts here:
>  /usr/local/include
>  /usr/lib/gcc/i486-linux-gnu/4.3.3/include
>  /usr/lib/gcc/i486-linux-gnu/4.3.3/include-fixed
>  /usr/include
> End of search list.
> 
> On compilation, I get errors that indicate that gcc is not finding the 
> header:
> dan@dan-desktop:~/source/unleashed/ch11$  gcc -std=c99 -Wall -Wextra 
> t1.c -o out/tmp/ccmpPiuM.o: In function `ReadFile':
> t1.c:(.text+0x7e): undefined reference to `AllocStrArray'
> t1.c:(.text+0x147): undefined reference to `AddRowsToStrArray'
> t1.c:(.text+0x187): undefined reference to `ResizeOneString'
> t1.c:(.text+0x203): undefined reference to `AddRowsToStrArray'
> t1.c:(.text+0x246): undefined reference to `FreeStrArray'
> t1.c:(.text+0x269): undefined reference to `ConsolidateStrArray'
> /tmp/ccmpPiuM.o: In function `main':
> t1.c:(.text+0x322): undefined reference to `FreeStrArray'
> collect2: ld returned 1 exit status
> dan@dan-desktop:~/source/unleashed/ch11$
> 
> So it doesn't find a header in the same directory.  So, I decide to put 
> the header where gcc *is* looking, but ubuntu won't let me put a header 
> in any of the directories that are included in the search.
> 
> Question 1:  Where am I supposed to put home-rolled headers when I 
> compile with gcc on ubuntu?
> 
> Thanks for your comment.

Dear franck,

what's missing is not the header but the symbols at link time. You 
should probably link with a .a or .so file that comes with your header file.

Yann
Technical Details
Message-ID: <hj7ei4$i9o$1@amma.irisa.fr>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!univ-lyon1.fr!niouze.cines.fr!unice.fr!news-sop.inria.fr!news-rocq.inria.fr!news.irisa.fr!not-for-mail
References: <7ror8bFjn6U1@mid.individual.net>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1200bcf240,4af9266eb6a90621
X-Google-Attributes: gid1200bcf240,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!univ-lyon1.fr!niouze.cines.fr!unice.fr!news-sop.inria.fr!news-rocq.inria.fr!news.irisa.fr!not-for-mail
From: Yann Renard <yann.renard@irisa.nospam.fr>
Newsgroups: alt.os.linux.ubuntu,gnu.gcc.help
Subject: Re: where to put custom headers
Date: Wed, 20 Jan 2010 18:26:20 +0100
Organization: Irisa, Rennes (FR)
Lines: 51
Message-ID: <hj7ei4$i9o$1@amma.irisa.fr>
References: <7ror8bFjn6U1@mid.individual.net>
NNTP-Posting-Host: cervelet.irisa.fr
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: amma.irisa.fr 1264008580 18744 131.254.15.47 (20 Jan 2010 17:29:40 GMT)
X-Complaints-To: abuse@irisa.fr
NNTP-Posting-Date: Wed, 20 Jan 2010 17:29:40 +0000 (UTC)
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
In-Reply-To: <7ror8bFjn6U1@mid.individual.net>