发件人:
Volker Grabsch <address@hidden>
收件人:
address@hidden
发送日期:
2011年11月16日, 星期三, 下午 4:35
主题: Re:
[Mingw-cross-env-list] VS can't use the static library
compiled with MinGW under Debian
靖飞 胡 schrieb:
> But now I converted the project into a static library,
> say mylib.a, but in visual studio I can't use the
mylib.a:
> When I write a simple test function invoking the
functions
> of the static library(mylib.a), the unresolved external
> symbol error occurred during linking stage. Anyone know
> how to make VS could use the static library compiled
with
> MinGW? Any ideas will be appreciated.
Static linking is compiler specific. You can't expect this
to work across different compilers (MinGW vs. VS). Usually,
you can't even expect this to work with multiple versions
of the same compiler, although you could have some luck
here.
However, why do you want to do that?
If you want to distribute binaries for your library, you
should probably use dynamic linking (DLL files) instead of
static linking. If your final goal is an application (not a
library), then simply build everything with the same
compiler.
Also note that this mailing list is mostly about cross
compiling. Basic questions about static vs. dynamic linking
have better chances for good answers on the MinGW-Users
mailing list.
Greets,
Volker
--
Volker Grabsch
---<<(())>>---