Subject: Re: Linking against .lib libraries
From: [email-masked] (Earnie Boyd)

6 Sep 1998 15:53:56 -0700
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
To: Serge Torres <[email-masked]>, [email-masked]

---Serge Torres <[email-masked]> wrote:
>
> Hi,
> 
> I'm trying to build a dll wich has a code written and compiled with
cygwin32
> and at the last stage has to be linked it a .lib library from
Microsoft.
> 
> I need this combination to create a dll that implements new extended
> procedures
> in MS SQLSERVER.
> 
> I have manged to link to the library but I get a lot of warnings
("ignoring
> duplicate  section `.text`" as mentioned, in a not very different
context by
> Berend Ozceri from Istanbul.
> 
> The dll is definetly unworkable, it will not be loaded by SQL SERVER
and
> when viewed under an hex editor will show a lot of source code
included.
> 
> I think I've understood that .lib file format is not compatible with
..a 
> format.
> 
> Is it ture ? 

Yes it is true, at least for the moment.

> Is it really impossible to link cygwin (egcs 2.0.1) generated
against .lib libraries ? 

Yes it is impossible to link against the .lib files.

> Is it really hopeless ? 

No it is not hopeless.  You can use `nm' and `dlltool' to create a
libsomelib.a from the somelib.lib file.  I the exactly what to do.  I
did post it a while back.

Basically you need to create a somelib.def file from the `nm
--defined-only --demangle somelib.lib | grep ' [DCT] ' > somelib.def'.
 Then add `EXPORTS' as the first line to the file.  Then use dlltool
to create the libsomelib.a file.

I hope my memory is serving me correctly.  If this doesn't work take a
look at the impdef tool on Colin Peters' page.  It will create a def
output based on the .dll but when I tried this it wasn't giving me the
correct stuff.

> I would not like to have to move back to VC.

I haven't even been there yet.

> 
> Thanks
> 
> Serge Torres
> Centre National de Documentation Pedagogique
> 

==
-        \\||//
---o0O0--Earnie--0O0o----
[email-masked]
------ooo0O--O0ooo-------

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com

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