[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mingw-cross-env-list] VS can't use the static library compiled with
Re: [Mingw-cross-env-list] VS can't use the static library compiled with MinGW under Debian
Wed, 16 Nov 2011 09:35:37 +0100
靖飞 胡 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