![]() |
Using a VC++ .lib file from g++
Hi.
If I have a .lib file which I think most likely compiled from Visual Studio, can I link that .lib in a project that uses g++/ld ? I am using mingw32 compiler. I checked the manual -- doesn't seems to indicate any restrictions about this. Is mingw32 a good choice to begin with? I know the contents and functions within that .lib. What I am trying to do is building it in a non-visual-studio environment. Thanks. |
Re: Using a VC++ .lib file from g++
c++ libraries created with Microsoft compilers probably can not be used with other compilers because of the non-standard way of mangling symbol names, and non-standard format of libraries. I'd suggest you get the source code of the library and compile it with your g++ compiler.
|
Re: Using a VC++ .lib file from g++
Ancient Dragon is right. Trying to use an M$ library with g++ is like trying to use a VW transmission in a Ford truck. They don't play well together.
|
Re: Using a VC++ .lib file from g++
Not directly related, but though I'd mention that this doesn't happen in C, thanks to a lack of name mangling. Unfortunately, if your .lib is already compiled and/or the library code isn't in C, then you'll still have a problem...
|
Re: Using a VC++ .lib file from g++
Quote:
|
Re: Using a VC++ .lib file from g++
Quote:
|
Re: Using a VC++ .lib file from g++
Modification of names in C is more commonly called decoration and involves more than underscores. It provides information about the calling convention (who cleans the stack frame, for one).
C++ (and other languages) uses mangling, since it has to provide copious amounts of information (for overloading and other purposes). Each implementation has to convey more information than a simple description of parameters; for instance, interrupts (some due to error conditions) in one chip family may do entirely different things to the stack frame than interrupts from a different chip family. Layout of structs may be constrained by physical memory implementations. All this can make it very difficult to employ a standardized scheme. Why compilers that deal with the same architecture/hardware use differing schemes is anyone's guess. |
Re: Using a VC++ .lib file from g++
Quote:
Microsoft: "We don't want none o' that Borland sh** being used with our compilers!" |
Re: Using a VC++ .lib file from g++
Quote:
|
| All times are GMT -5. The time now is 3:29 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC