windows *.lib files? [u]

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

windows *.lib files? [u]

Andreas Jellinghaus-2
Hi everyone,

does anyone know what windows *.lib files are?

Are those used for static linking with a library only,
i.e. like unix libfoo.a files? (same idea, different file format)

the reason I'm asking: I'm trying to compile openssl and opensc for
windows using mingw. I can create exe files and dlls fine, but I
can't create those lib files. So I wonder what they are used for
and how important it is to have them. (If not very important
I simply might go with the mingw build system and ignore them).

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: windows *.lib files? [u]

Peter Stuge
On Mon, Jul 04, 2005 at 09:28:24PM +0200, Andreas Jellinghaus [c] wrote:
> Hi everyone,
>
> does anyone know what windows *.lib files are?

They're linker stubs, import libraries.

Read more on:

http://mirrors.zoreil.com/webclub.kcom.ne.jp/ma/colinp/win32/dll/make.html
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/win32.html
http://www.mingw.org/MinGWiki/index.php/create%20import%20DLL-libraries
http://www.pacifier.com/~jgibbon/program_tip_4.htm


//Peter
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: windows *.lib files? [u]

Andreas Jellinghaus-2
Thanks Peter,

maybe I missed something, but none of the links
helps me.

the first one creates an *.a file - ar archive.
not a microsoft lib file. (same idea, but usable
with mingw only, while *.lib should work with any
windows compiler).

the second link has "--out-implib" and my ld has
that option and it simply does nothing, not even
give me a warning or error why it does nothing.

the third and forth seem to deal mostly with third
party dlls and creating *.def files. but I have all
the source and objects and the def file, so I'm
in a different situation / my problem is not
creating the def file.

anyway, it seems like it is possible to link
against a *.dll without having a *.lib?
so it isn't important having one?

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: windows *.lib files? [u]

Andreas Jellinghaus-2
One document on dll generation used "-mdll" and the result
was working fine.

After I replaced "-mdll" with "-shared" suddenly --out-implib
works. But: it creates an ar file, not a lib file.

So what is missing is a tool to convert *.a into *.lib.
(I guess the content is ok.) Any idea?

Regards, Andreas
_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel
Reply | Threaded
Open this post in threaded view
|

Re: windows *.lib files? [u]

Roumen Petrov-2
> One document on dll generation used "-mdll" and the result
> was working fine.
>
> After I replaced "-mdll" with "-shared" suddenly --out-implib
> works. But: it creates an ar file, not a lib file.
>
> So what is missing is a tool to convert *.a into *.lib.
> (I guess the content is ok.) Any idea?
>

Library format on Windows depend from compilers.
MSC (after version 7/8?) create libs in COFF format (similar to ar file?).
BCC (ilink32 ?) create libs in OMF format.

>From a dll or def file implib.exe can create import library.
Similar tools is impdef - create def file with import statement from a dll.
Borland utility coff2omf can convert a lib from COFF to OMF format.

Usually on windows four libs should be created:
- dll with multithreading plus corresponding import lib. sample: XXXXmt.dll+XXXXmt.lib
- dll without multithreading plus corresponding import lib. sample: XXXX.dll+XXXX.lib
- static library with multithreading. sample: XXXXmt_a.lib
- static library without multithreading. sample: XXXX_a.lib

I don't know mingw and I guess that compiler flags are "{-shared|-static} -Wl,--out-implib,XXXX.lib".
I guess that mingw gcc define macro _DLL when a dll is build :-\ .
MSC (but not BCC) might define macro _MT in case of multithreading :-\ .


gnu dlltool should create import libs from dlls.

implib - some links from search engine:
- http://www.digitalmars.com/ctg/implib.html
- http://www.geocities.com/SiliconValley/5806/implib32.htm
- http://www.devarticles.com/c/a/Cplusplus/DLL-Convetions-Issues-and-Solutions-Part-II/3/

"Stdcall and DLL tools of MSVC and MinGW" - http://www.geocities.com/yongweiwu/stdcall.htm

_______________________________________________
opensc-devel mailing list
[hidden email]
http://www.opensc.org/cgi-bin/mailman/listinfo/opensc-devel