AFAIK, Early Ehlinger is right.
But not all is bad news. Since you seem to have access to MSVC you can bu=
a DLL from the .LIB an then link to it.
Just make a .DEF with all symbols that you'll need and link it (try using
DUMPBIN /EXPORTS or /SYMBOLS to help you in this task).
The command line will be similar to the following, but probably will have=
add some libraries such as MSVCRT.LIB...
LINK /DLL /OUT:YOURDLL.DLL /DEF:YOURDEF.DEF YOURLIB.LIB
with the same def you can make a lib???.a using dlltool:
dlltool --input-def yourdef.def --dllname yourdll.dll --output-lib
I already made this with succes with glaux.lib (a static library that com=
with Microsoft OpenGL).
There can be some problems though... If you need to use global data from
that library (i.e., anything that isn't a function), in the header that
declares that variable you must add __declspec(dllimport). This is becaus=
the way that Windows dinamically links DLLs: when an EXE is linked to a
variable from a DLL it is given a pointer to the address of that variable
and not the adress itself. So the compiler must be aware of this extra le=
I hope this helps.
----- Original Message -----
From: "Early Ehlinger Sr." <earlye@...>
Sent: Thursday, September 20, 2001 10:18 PM
Subject: Re: [Mingw-users] Linking a microsoft compiled library (non DLL)
with mingw compiled code...
> I'm no expert, but I believe that that library file formats are
> and therefore mingw will not be able to link a MSVC .lib at all. (henc=
> presence of the lib*.a files laying around the mingw tree).
> A similar argument was given as to why Borland C++ Builder couldn't lin=
> MSVC .lib files.
> Probably not what you wanted to hear, I know... Hopefully somebody els=
> here will prove me wrong.
> -- Early Ehlinger
> ----- Original Message -----
> From: "Geoffrey S. Zub" <gzub@...>
> To: <mingw-users@...>
> Sent: Thursday, September 20, 2001 12:54 PM
> Subject: [Mingw-users] Linking a microsoft compiled library (non DLL) w=
> mingw compiled code...
> > I have a 3rd party API that is distributed as a .lib. In the past we
> > compiled everything using Microsoft Visual Studio. For the current
> > we moved to mingw and gcc tools. However I am running into problems
> > code that was compiled in mingw with the .lib provided by the custome=
> > two hints that they give are that it is compiled with _STRICT defined
> > they it was built with the setting Multithreaded DLL. When we compil=
> > windows this was not a problem. I am running into either __alloca be=
> > undefined or if I get it to compile with a MSVCRT error when I try to
> > it...
> > Any pointers on what compile & link commands I should use to link thi=
> > Thanks in advance,
> > Geoff
> > -------
> > Geoffrey S. Zub - Senior Software Engineer - 508 986-1000
> > VistaSource Inc. - gzub@... - http://www.vistasource.com
> > _______________________________________________
> > MinGW-users mailing list
> > MinGW-users@...
> > You may change your MinGW Account Options at:
> > https://lists.sourceforge.net/lists/listinfo/mingw-users
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> MinGW-users mailing list
> You may change your MinGW Account Options at: