delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/05/18:30:38

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Lyman Neuschaefer" <lyman AT bcsisims DOT com>
To: "Andrew Markebo" <flognat AT flognat DOT myip DOT org>
Cc: <cygwin AT cygwin DOT com>
Subject: RE: Unresolved references to opendir/readdir/closedir
Date: Mon, 5 Mar 2001 16:07:45 -0700
Message-ID: <NDBBIAKKHKMFGDHKLMKPGENGCBAA.lyman@bcsisims.com>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
In-Reply-To: <m3g0grvpa2.fsf@master.athome>

Thanks for all of your replies.  I found my mistake.

I should have included <dirent.h>, but was including <sys/dirent.h>.
By including the latter header file opendir/readdir/closedir were
symbols with implied C linkage.  However, I was using g++, and so
needed these symbols with C++ linkage.  Since dirent.h is, in effect,

extern "C" {

#include <sys/dirent.h>

}

when using g++, <dirent.h> was the correct header file to include.

-Lyman

-----Original Message-----
From: flognat AT master DOT athome [mailto:flognat AT master DOT athome]On Behalf Of
Andrew Markebo
Sent: Monday, March 05, 2001 3:12 PM
To: Lyman Neuschaefer
Cc: cygwin AT cygwin DOT com
Subject: Re: Unresolved references to opendir/readdir/closedir



[...]

|  g++  -o svintf SVIntf.o cnf.a \
|  ../message/message.a \
|  ../viewers/table.a \
|  ../common/common.a \
|  ../../../tools/bcgui/bcgui.a \
|  ../../../tools/support/support.a \
|  -L/usr/local/LessTif/Motif2.0/lib -L/usr/X11R6/lib -L/lib -lc -lXm -lXt -
lS
| M -lICE -lX11

Here might be a problem, you link in libc before motif, X11 & co,
normally gcc doesn't look back when seatching for symbols, and if the
library is loaded once it doesn't do it again, so if Xm, Xt, SM, ICE,
X11 want to access functions in libc they can't because libC is
already processed...

So either move the -lc to the end of the line, or omit it as suggested
before, because it is handled automagically.

If the problem persists try throwin -v or -V on gcc when linking,
might give you some hints..

|  cnf.a(SVIntfLoader.o)(.text+0x2942):SVIntfLoader.C: undefined reference
to
| `opendir(char const *)'

*sniff* *sniff* is this X11/Motif or whatever file?

        /Andy


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019