成功通过CMake(CMake-3.12.3)后,配置步骤如下:
cmake.exe ..\mysql-connector-c++-8.0.17-src -G "MinGW Makefiles" -DBUILD_STATIC=ON
我被困在:
cmake.exe --build . --config Debug
这给了我:
[ 2%] Built target save_linker_opts
[ 3%] Building CXX object uuid/src/CMakeFiles/uuid_gen.dir/uuid_gen.cc.obj
D:\Daten\LiDoSourcen\mysql-connector-c++-8.0.17-src\cdk\extra\uuid\src\uuid_gen.cc:46:26: error: conflicting declaration 'typedef CRITICAL_SECTION pthread_mutex_t'
46 | typedef CRITICAL_SECTION pthread_mutex_t;
| ^~~~~~~~~~~~~~~
In file included from D:/Daten/Portable/MinGw-msys64/mingw64/include/c++/9.2.0/x86_64-w64-mingw32/bits/gthr-default.h:35,
from D:/Daten/Portable/MinGw-msys64/mingw64/include/c++/9.2.0/x86_64-w64-mingw32/bits/gthr.h:148,
from D:/Daten/Portable/MinGw-msys64/mingw64/include/c++/9.2.0/ext/atomicity.h:35,
from D:/Daten/Portable/MinGw-msys64/mingw64/include/c++/9.2.0/bits/basic_string.h:39,
from D:/Daten/Portable/MinGw-msys64/mingw64/include/c++/9.2.0/string:55,
from D:/Daten/Portable/MinGw-msys64/mingw64/include/c++/9.2.0/stdexcept:39,
from D:\Daten\LiDoSourcen\mysql-connector-c++-8.0.17-src\cdk\extra\uuid\src\uuid_gen.cc:40:
D:/Daten/Portable/MinGw-msys64/mingw64/x86_64-w64-mingw32/include/pthread.h:271:18: note: previous declaration as 'typedef intptr_t pthread_mutex_t'
271 | typedef intptr_t pthread_mutex_t;
| ^~~~~~~~~~~~~~~
结果是。
我昨天更新了MinGW / msys2环境,因此我应该拥有最新版本的编译器。
我查看了两个位置,但找不到任何明显的
#define
或可用于正确编译的内容。有任何提示或疑问吗?
最佳答案
我能够使用untrunc
在Windows上构建mingw-w64
。
安装mingw-w64时,它会询问您首选的线程模型,您可以更改该模型。
Windows构建成功。在用cygwin
安装所有软件包之后,我随后安装了NASM
和YASM
并将其路径添加到环境变量PATH
中。
然后我使用MinGW使用以下命令构建了libav-12.3
:
./configure --enable-pthreads --enable-shared
然后使用cygwin运行
make
命令。
关于c++ - 在Windows上使用MinGW构建mysql-connector-c++-8.0.17-src,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58134331/