Subject: Re: undefined references
From: [email-masked] (Mumit Khan)

29 Jan 1999 23:38:39 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
To: Brian Ryner <[email-masked]>
Cc: [email-masked]

On Thu, 28 Jan 1999, Brian Ryner wrote:

> Hi-
> 
> I'm attempting to port Mozilla's NSPR library to compile under Cygwin. 
> I'm using B20.1, and the egcs 1.1.1 binaries from the cygwin site.  I'm
> having a problem when it tries to build the DLL.  The command line it's
> running and the errors that are generated are attached below.  It seems
> like I'm not linking to the right libraries, but I can't figure out
> which ones exactly.  Below the output I've also attached some of the
> lines of code where it says the undefined references are.  Any help is
> much appreciated.
> 
> ld  --dll -o WIN954.0_DBG.OBJ/libnspr21.dll -e _DllMain@12 --base-file

Few comments:
  
1. Don't use ld directly (if you do, you'll need to supply all the
   requisite libraries, such as -lcygwin and startup files manually);
   use `gcc'.

2. Use dllwrap to build the DLLs until DJ Delorie's work on ld to create
   DLLs directly is releases (or you could ask him to be a tester!).

3. _DllMain@12 is not correct entry point for Cygwin native programs. 
   It's __cygwin_dll_entry@12, which it dllwrap supplies for you.

   $ dllwrap -o foo.dll foo1.o foo2.o -lbar1 -lbar2

I'm assuming that you're trying to link with MSVC created objects, nor
are you trying to load this DLL from an MSVC app using LoadLibrary. If
it's the latter, use __cygwin_noncygwin_dll_entry@12 as the entry point
(``dllwrap --entry __cygwin_noncygwin_dll_entry@12'').

Regards,
Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".