我有一个数学库 ( ADOL-C ),它需要链接到另一个库 ( ColPack ) 以执行一些可选任务。
我可以在 Linux 中很好地编译它们,在 Windows 中单独编译 ADOL-C 或 ColPack,但是当我尝试在 Windows(MinGW 32,ld 2.22)中使用 ColPack 编译 ADOL-C 时,我遇到了以下问题:
$ make
Making all in ADOL-C
make[1]: Entering directory `/c/tests/ADOL-C-2.3.0/ADOL-C'
[...]
CC int_reverse_s.lo
CC int_reverse_t.lo
CXXLD libadolc.la
*** Warning: This system can not link to static lib archive /usr/lib/libColPack.
la.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have.
Creating library file: .libs/libadolc.dll.a
sparse/.libs/libsparse.a(sparsedrivers.o): In function `generate_seed_jac':
c:\tests\ADOL-C-2.3.0\ADOL-C\src\sparse/sparsedrivers.cpp:119: undefined referen
ce to `ColPack::BipartiteGraphPartialColoringInterface::BipartiteGraphPartialCol
oringInterface(int, ...)'
[...]
collect2: ld returned 1 exit status
make[5]: *** [libadolc.la] Error 1
make[5]: Leaving directory `/c/tests/ADOL-C-2.3.0/ADOL-C/src'
make[4]: *** [all-recursive] Error 1
我不能像在 MinGW 中那样只提供动态库,即使我使用 --enable-shared 配置 ColPack,我实际上从未从它的编译中获得任何共享库,只有 libColPack.[a|la|lai] 和 ColPack.exe .
有什么提示吗?