Hi, according to http://sourceforge.net/p/mingw-w64/discussion/723798/thread/7da101da :
*"Sorry, sharing static libraries with MSVC is not supported right now, the contributor who was supposed to work on this went MIA.The only sane way to do it right now is to use a DLL."* this problem seems to be a name mangling problem between mingw32 (or mingw-w64) and MSVC that cannot be solved easily other than using a shared lib instead. There is a objconv tool http://www.agner.org/optimize/#objconv that is able to change the names of symbols in existing object code that may help to create a MSVC compatible static lib in this special case. Cheers, Carl 2014-12-28 1:59 GMT+01:00 Matthew Brett <[email protected]>: > Hi, > > Sorry for this ignorant email, but we got confused trying to use > 'libnpymath.a' from the mingw builds of numpy: > > We were trying to link against the mingw numpy 'libnpymath.a' using > Visual Studio C, but this give undefined symbols from 'libnpymath.a' > like this: > > npymath.lib(npy_math.o) : error LNK2019: unresolved external symbol > _atanf referenced in function _npy_atanf > npymath.lib(npy_math.o) : error LNK2019: unresolved external symbol > _acosf referenced in function _npy_acosf > npymath.lib(npy_math.o) : error LNK2019: unresolved external symbol > _asinf referenced in function _npy_asinf > > (see : > http://nipy.bic.berkeley.edu/builders/dipy-bdist32-33/builds/73/steps/shell_6/logs/stdio > ) > > npymath.lib from Christophe Gohlke's (MSVC compiled) numpies does not > give such an error. Sure enough, 'npymath.lib' shows these lines from > `dumpbin /all npymath.lib`: > > 00000281 REL32 00000000 4F asinf > 00000291 REL32 00000000 51 acosf > 000002A1 REL32 00000000 53 atanf > > whereas `dumpbin /all libnpymath.a` shows these kinds of lines: > > 000008E5 REL32 00000000 86 _asinf > 000008F5 REL32 00000000 85 _acosf > 00000905 REL32 00000000 84 _atanf > > As far as I can see, 'acosf' is defined in the msvc runtime library. > I guess that '_acosf' is defined in some mingw runtime library? Is > there any way of making a npymath library that will pick up the msvc > math and so may work with both msvc and mingw? > > Sorry again if that's a dumb question, > > Matthew > _______________________________________________ > NumPy-Discussion mailing list > [email protected] > http://mail.scipy.org/mailman/listinfo/numpy-discussion >
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
