🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.linux
Article #326

Re: help: Undefined reference to '...'

#326
From: Chris Ahlstrom
Date: Fri, 25 May 2001 16:34
45 lines
2554 bytes
"David. E. Goble" wrote:
> 
> Hi All;
> 
> I have redHat 6.2 (server install)
> 
> I am trying to do some programming.
> 
> Tried these two;
> 
>         gcc testlibpq.c -I/usr/include/pgsql/ -L/usr/lib/
> 
> and
> 
>         gcc cube.cpp -I/usr/X11R6/include/ -L/usr/X11R6/lib/
> 
> both produce a list of;
> 
> .... Undefined reference to '...'
> collect2: ld returned 1 exit status
> 
> I understand this has something to do with linking...
> 
> What am I doing wrong or not doing. Please I need step by step
> instruction, thanks.

Can't give you steps, but it sounds like you're forgetting
to add an explicit reference to a library (*.a) or an object
module (*.o) that contains the definition of the function
or global variable "collect2".  So the linker/loader (ld)
cannot find it.  

    gcc testlibpq.c -I/usr/include/pgsql/ -L/usr/lib/ collect2.o

    gcc testlibpq.c -I/usr/include/pgsql/ -L/usr/lib/ mylibrary.a

I don't know what library/module collect2 would appear in.
Is an SQL thang?

Chris


-- 
Please enter your Message Activation
Code now to read this message
Technical Details
Message-ID: <3B0E8853.400F9370@home.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!wn2feed!wn1feed!worldnet.att.net!24.0.0.38!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.tn.home.com.POSTED!not-for-mail
References: <3b0bacc3.134395@news.adelaide.on.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c696,e7efa684ec24a406
X-Google-Attributes: gid10c696,public
X-Google-Thread: 102983,e7efa684ec24a406
X-Google-Attributes: gid102983,public
X-Google-Thread: 100c5f,e7efa684ec24a406
X-Google-Attributes: gid100c5f,public
X-Google-Thread: f9b51,e7efa684ec24a406
X-Google-Attributes: gidf9b51,public
X-Google-ArrivalTime: 2001-05-25 09:38:09 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!news.iac.net!news-out.cwix.com!newsfeed.cwix.com!wn2feed!wn1feed!worldnet.att.net!24.0.0.38!newshub2.rdc1.sfba.home.com!news.home.com!news1.rdc1.tn.home.com.POSTED!not-for-mail
Message-ID: <3B0E8853.400F9370@home.com>
From: Chris Ahlstrom <ahlstromc@home.com>
Organization: major league software, llc
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.4.2-2 i686)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: alt.linux,aus.computers.linux,comp.os.linux.development.apps,comp.os.linux.setup
Subject: Re: help: Undefined reference to '...'
References: <3b0bacc3.134395@news.adelaide.on.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 45
Date: Fri, 25 May 2001 16:34:42 GMT
NNTP-Posting-Host: 24.9.74.156
X-Complaints-To: abuse@home.net
X-Trace: news1.rdc1.tn.home.com 990808482 24.9.74.156 (Fri, 25 May 2001 09:34:42 PDT)
NNTP-Posting-Date: Fri, 25 May 2001 09:34:42 PDT