MinGW cmake:“ pthread_mutex_init”的多个定义

时间:2018-07-16 12:19:19

标签: c++ cmake mingw

试图在MinGW上使用Cmake构建一些库,但出现此错误:

c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libpthread.a(libwinpthread_la-mutex.o):mutex.c:(.text+0x70): multiple definition of `pthread_mutex_lock'
lib/tokenizer/libOpenNMTTokenizer.dll.a(d000208.o):(.text+0x0): first defined here
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libpthread.a(libwinpthread_la-mutex.o):mutex.c:(.text+0x320): multiple definition of `pthread_mutex_unlock'
lib/tokenizer/libOpenNMTTokenizer.dll.a(d000211.o):(.text+0x0): first defined here
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libpthread.a(libwinpthread_la-mutex.o):mutex.c:(.text+0x450): multiple definition of `pthread_mutex_init'
lib/tokenizer/libOpenNMTTokenizer.dll.a(d000207.o):(.text+0x0): first defined here
c:/mingw/mingw/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libpthread.a(libwinpthread_la-mutex.o):mutex.c:(.text+0x490): multiple definition of `pthread_mutex_destroy'
lib/tokenizer/libOpenNMTTokenizer.dll.a(d000206.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [CMakeFiles\onmt.dir\build.make:248: libonmt.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:73: CMakeFiles/onmt.dir/all] Error 2
mingw32-make: *** [Makefile:129: all] Error 2

0 个答案:

没有答案