🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #42340

Re: "undefined reference" when linking lib functions w/gcc 2.7.0

#42340
From: Ami Fischman
Date: Wed, 13 Dec 1995 00:00
23 lines
1455 bytes
> 4) gcc -L/var/httpd/lib -lmsql getmsql.c

> gcc -c -o cgiparse cgiparse.c
> 	The error I get when I try to have gcc do linking is the following:
> gcc -c cgiparse cgiparse.c
> /tmp/cca004141.o(.text+0xe27): undefined reference to 'HTUnEscape'
> /tmp/cca004141.o(.text+0x105c): undefined reference to 'HTUnEscape'
> /tmp/cca004141.o(.text+0x1074): undefined reference to 'HTUnEscape'
> ...
> 	Why can't gcc find my library and header files to link my program?
> Where are the pathes stored that gcc uses to search for these files?
> What am I doing wrong?
> 

'cuz you're not telling gcc which library to look in.  If you have a library
that defines these symbols, say it's called libHT.a, you need to tack on
-lHT on the end of that gcc line.  Assuming libHT.a is in a standard
directory, else use the -L switch to give the right dir.

-- 
					--Ami
					  Have YOU hugged YOUR smurf today?
What I want is all of the power and none of the responsibility.
Technical Details
Message-ID: <4an4mu$1m0s@saba.info.ucla.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <4altmb$tdq@flood.weeg.uiowa.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,2396443c05fbe1e7
X-Google-Attributes: gid11318c,public
From: a540ami@pic.ucla.edu (Ami Fischman)
Subject: Re: "undefined reference" when linking lib functions w/gcc 2.7.0
Date: 1995/12/13
Message-ID: <4an4mu$1m0s@saba.info.ucla.edu>
X-Deja-AN: 121757926
distribution: world
references: <4altmb$tdq@flood.weeg.uiowa.edu>
organization: University of California, Los Angeles
newsgroups: gnu.gcc.help