Article View: alt.os.linux.ubuntu
Article #115where to put custom headers
From: frank
Date: Wed, 20 Jan 2010 17:02
Date: Wed, 20 Jan 2010 17:02
45 lines
2462 bytes
2462 bytes
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. -- frank
Technical Details
Message-ID:
<7ror8bFjn6U1@mid.individual.net>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1200bcf240,4af9266eb6a90621,start 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!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: frank <frank@example.invalid> Newsgroups: alt.os.linux.ubuntu,gnu.gcc.help Subject: where to put custom headers Date: Wed, 20 Jan 2010 10:02:04 -0700 Lines: 45 Message-ID: <7ror8bFjn6U1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net LzemG/dOrV1lEWE1+DEKPA2UUTJdFUgN/3cgfkzX3VZIM0LGdX Cancel-Lock: sha1:rz9yTAXdpJLt3TvTYydNTWKI/nw= User-Agent: Thunderbird 2.0.0.23 (X11/20090817)