From: Fabian W. <f.w...@gm...> - 2001-05-31 10:49:16
|
Hi! Recently I discovered how easy it is to produce DLLs using Mingw32. I use the cross-compiler by Reinhard Jessich on linux, and I do get some results (even though libtool is complaining about missing stdc++ which I don't know how to get rid of). The main question is: I am working on a cross platform library which should be compiled under Linux as DLL and used with MS VC++ later on. Is there a possibility to produce compatible .lib files? I reckon that dlltool has the possibility to generate import libraries, but they don't seem to work on VC++, as there are tons of unresolved references... or is there a specific way to invoke dlltool accordingly? Any hint would help me! Thanks lot! Fabian -- =======> http://www.fab-online.de <=======> W.E.N.Z.E.L. |
From: Pablo B. K. <pb...@em...> - 2001-05-31 11:53:46
|
Fabian Wenzel wrote: > The main question is: I am working on a cross platform library which > should be compiled under Linux as DLL and used with MS VC++ later on. Is > there a possibility to produce compatible .lib files? I reckon that > dlltool has the possibility to generate import libraries, but they don't > seem to work on VC++, as there are tons of unresolved references... or > is there a specific way to invoke dlltool accordingly? > > Any hint would help me! Thanks lot! I compile very often against C VC++ DLL libs using mingw and dlltool (to generate a .a lib file from the LIB lib). If you don't have the DLL symbol definition files, there are some tools to extract them. However, in such cases I always end up adding/reformatting some ids by hand. It takes a little time but works fine (nm -s is your friend). I remember to have compiled & dynamically linked against a few C++ VC++ DLLs using the same method. However it seems that there were some runtime crashes --which I didn't stop to analyze thoroughly. Though it was a zillion lines of code ago, so I can't recall very well. Hope this helps. Cheers! -- Pablo Bleyer Kocik | pbleyer |"Rintrah roars & shakes his fires in the burdend air; @embedded.cl | Hungry clouds swag on the deep" William Blake |
From: Fabian W. <f.w...@gm...> - 2001-05-31 12:18:48
|
Thanks for the fast reply and for the help! Hmmm, but I think you gave me some hints on how to convert a .lib - file to an .a file using dlltool, right? The problem that I have is that using mingw32-gcc on my sources, I do get an .a - file and a .dll, but when I want to use it on MS VC++, there is no .lib - file. (And using the .a - file as a .lib - file does not work). So basically I'd like to do it the other way around: Not converting VC++ - "DLL"s/"LIB"s to mingw32 "DLL"s/"A"s but somehow getting VC++ - usable "LIB" - import libraries with mingw32/dlltool. Do you have any clues on this? Cheers, Fabian Pablo Bleyer Kocik wrote: > > Fabian Wenzel wrote: > > > The main question is: I am working on a cross platform library which > > should be compiled under Linux as DLL and used with MS VC++ later on. Is > > there a possibility to produce compatible .lib files? I reckon that > > dlltool has the possibility to generate import libraries, but they don't > > seem to work on VC++, as there are tons of unresolved references... or > > is there a specific way to invoke dlltool accordingly? > > > > Any hint would help me! Thanks lot! > > I compile very often against C VC++ DLL libs using mingw and dlltool (to > generate a .a lib file from the LIB lib). If you don't have the DLL symbol > definition files, there are some tools to extract them. However, in such > cases I always end up adding/reformatting some ids by hand. It takes a > little time but works fine (nm -s is your friend). > > I remember to have compiled & dynamically linked against a few C++ VC++ > DLLs using the same method. However it seems that there were some runtime > crashes --which I didn't stop to analyze thoroughly. Though it was a zillion > lines of code ago, so I can't recall very well. > > Hope this helps. Cheers! > > -- > Pablo Bleyer Kocik | > pbleyer |"Rintrah roars & shakes his fires in the burdend air; > @embedded.cl | Hungry clouds swag on the deep" - William Blake > > _______________________________________________ > MinGW-users mailing list > Min...@li... > > You may change your MinGW Account Options at: > http://lists.sourceforge.net/lists/listinfo/mingw-users -- =======> http://www.fab-online.de <=======> W.E.N.Z.E.L. |
From: Henrik S. <hst...@pr...> - 2001-05-31 14:05:55
|
Fabian Wenzel <f.w...@gm...> wrote: > So basically I'd like to do it the other way around: Not converting VC++ > - "DLL"s/"LIB"s to mingw32 "DLL"s/"A"s but somehow getting VC++ - usable > "LIB" - import libraries with mingw32/dlltool. Do you have any clues on > this? well pablo mentioned export definition files. basically when you're creating the .a library use the option --output-def <filename.def> to generate an export definition file. then i suppose you can supply the dll and the .def file to the microsoft linker and get an import library. i know this does at least work the other way around. (i don't have lib.exe here to make sure) -henrik |
From: Franco B. <fra...@we...> - 2001-05-31 17:13:28
|
A fragment from MS VC++ Help: Working with Import Libraries and Export Files Home | =A0Overviews You can use LIB with the /DEF option to create an import library and an export file. LINK uses the export file to build a program that contains exports (usually a dynamic-link library (DLL)), and it uses the import=20 library to resolve references to those exports in other programs. In most situations, you do not need to use LIB to create your import library. When you link a program (either an executable file or a DLL) tha= t contains exports, LINK automatically creates an import library that descr= ibes=20 the exports. Later, when you link a program that references those exports, yo= u specify the import library. However, when a DLL exports to a program that it also imports from, whether directly or indirectly, you must use LIB to create one of the imp= ort libraries. When LIB creates an import library, it also creates an export = file. You must use the export file when linking one of the DLLs. SO: lib /DEF:mydll.def will build the import lib mydll.lib. Ciao, Franco |