Article View: alt.linux
Article #329Re: help: Undefined reference to '...'
From: Arthur H. Gold
Date: Sat, 26 May 2001 15:44
Date: Sat, 26 May 2001 15:44
50 lines
2596 bytes
2596 bytes
Chris Ahlstrom wrote: > > "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? `collect2' is part of `ld' HTH, --ag -- Artie Gold, Austin, TX (finger the cs.utexas.edu account for more info) mailto:agold@bga.com or mailto:agold@cs.utexas.edu -- I am looking for work. Contact me.
Technical Details
Message-ID:
<3B0FCF41.83A12CDF@bga.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.skycache.com!Cidera!feed1.realtime.netReferences:
<3b0bacc3.134395@news.adelaide.on.net> <3B0E8853.400F9370@home.com>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: f9b51,e7efa684ec24a406 X-Google-Attributes: gidf9b51,public X-Google-Thread: 102983,e7efa684ec24a406 X-Google-Attributes: gid102983,public X-Google-Thread: 100c5f,e7efa684ec24a406 X-Google-Attributes: gid100c5f,public X-Google-ArrivalTime: 2001-05-26 08:38:53 PST Message-ID: <3B0FCF41.83A12CDF@bga.com> Date: Sat, 26 May 2001 10:44:01 -0500 From: "Arthur H. Gold" <agold@bga.com> Organization: UTCS OOPS Group X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17-21mdk 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> <3B0E8853.400F9370@home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: max5-124.ip.realtime.net X-Trace: 26 May 2001 11:00:51 -0500, max5-124.ip.realtime.net Lines: 50 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.skycache.com!Cidera!feed1.realtime.net