🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: where to put custom headers

#119
From: frank
Date: Fri, 22 Jan 2010 02:40
39 lines
2628 bytes
Jan Seiffert wrote:

> These are not messages from gcc not finding a header, these are messages from
> the linker ("ld returned 1 exit status"). When you header contains more than
> just a bunch of defines and datatypes, you need the coresponding object files
> where the compiled code of the defined functions reside. Either as object files
> (.o), archive (.a) or shared library (.so).
> You have to pass them on the link line. Please look at the Manual for the
> options -L and -l (for .o's you need no options).
> 
> Look around in your Ubuntu System, you have /usr/include, a bunch of system
> header files (text only), and /usr/lib, where the librarys for the system libs
> reside (the binaries).
> Where you put your project stuff, thats up to you. As long as your project is
> not part of the installed System, it has no business in writing to the system paths.
> 
> Maybe before you "unleash" C, you want to read a tutorial on how building
> software under Unix works (or more concrete the classic multipart C stack:
> preprocessor, compiler, assembler, linker), because you just ran into the "what?
> a header is not the complete lib"-FAQ
> 
>> 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.
>>
> 
> Because these are system directories, you need the right permission to do so.
> Something with "sudo cp ..."
> 
>> Question 1:  Where am I supposed to put home-rolled headers when I
>> compile with gcc on ubuntu?
>>
> 
> Right beside the rest of your project, no need to put them somewhere else.


Thanks, Jan, everything you write here is correct and helpful.
-- 
frank
Technical Details
Message-ID: <7rshh8Fa3vU2@mid.individual.net>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
References: <7ror8bFjn6U1@mid.individual.net> <hj7i8j$543$00$1@news.t-online.com>

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!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: Re: where to put custom headers
Date: Thu, 21 Jan 2010 19:40:40 -0700
Lines: 39
Message-ID: <7rshh8Fa3vU2@mid.individual.net>
References: <7ror8bFjn6U1@mid.individual.net> <hj7i8j$543$00$1@news.t-online.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net guu+WHfNCGEn4Pu6hpR+gQ2EoUYKcfTMb/5qC4qTvAVPX7jwT9
Cancel-Lock: sha1:kPlun5lyuJEybCzoJiRGxtT3HT0=
User-Agent: Thunderbird 2.0.0.23 (X11/20090817)
In-Reply-To: <hj7i8j$543$00$1@news.t-online.com>