🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.linux
Article #1104

Re: How do I add a library to the include path?

#1104
From: J. Otto Tennant
Date: Sat, 29 Jan 2000 00:00
37 lines
1940 bytes
Jack Kelly Dobson <jdobson@binc.net> writes:

>Hello?

>Can someone tell me how to add a library to the include path?

>I'd like to be able to #include "foo.h" rather than #include
>"/usr/local/include/foo/foo.h".

>Any ideas?

Just between you, me, and the gatepost, I'd suggest that, in addition to
the replies previously made, you think about using "make".

You really do not want to type

	gcc -o foo -I/usr/local/include foo.c

very often.

Create a subdirectory 'foo', in which you store 'foo.c' and a
Makefile which looks something like this:

#-*-Makefile-*-
CINC= -I/usrlocal/include/foo -Ianyotherfile
CFLAGS+=$(CINC)
foo:	foo.o
foo.o:	foo.c

and let 'make' do the work for you.

(The proposed Makefile may have to be adjusted for various flavours of
"make", and I haven't tested it.
--
J.Otto Tennant                                                   jotto@pobox.com
                   Forsan et haec olim meminisse juvabit.
              Charter Member of the Vast Right Wing Conspiracy
Technical Details
Message-ID: <uowk4.8967$v31.972110@ptah.visi.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <389218F4.E6FA9DA2@binc.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,741afaa4ec23a612
X-Google-Attributes: gid11318c,public
X-Google-Thread: faa64,741afaa4ec23a612
X-Google-Attributes: gidfaa64,public
X-Google-Thread: 10a73c,741afaa4ec23a612
X-Google-Attributes: gid10a73c,public
X-Google-Thread: f65d0,741afaa4ec23a612
X-Google-Attributes: gidf65d0,public
X-Google-Thread: 100c5f,741afaa4ec23a612
X-Google-Attributes: gid100c5f,public
From: jot@visi.com (J. Otto Tennant)
Subject: Re: How do I add a library to the include path?
Date: 2000/01/29
Message-ID: <uowk4.8967$v31.972110@ptah.visi.com>
X-Deja-AN: 579074314
References: <389218F4.E6FA9DA2@binc.net>
X-Complaints-To: abuse@visi.com
X-Trace: ptah.visi.com 949129882 209.98.98.8 (Sat, 29 Jan 2000 01:11:22 CST)
NNTP-Posting-Date: Sat, 29 Jan 2000 01:11:22 CST
Newsgroups: alt.linux,alt.os.linux,gnu.gcc,gnu.gcc.help,linux.dev.gcc