C++ 如何使用boost\u thread\u win32-mt-s构建boost(使用mingw进行交叉编译)
我无法使用MinGW在Linux上为Windows构建Boost(我无法创建Boost\u thread\u win32-mt-s) 这是操作系统的一个版本:C++ 如何使用boost\u thread\u win32-mt-s构建boost(使用mingw进行交叉编译),c++,linux,windows,boost,mingw,C++,Linux,Windows,Boost,Mingw,我无法使用MinGW在Linux上为Windows构建Boost(我无法创建Boost\u thread\u win32-mt-s) 这是操作系统的一个版本: # lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS Release: 14.04 Codename: trusty 这是mingw的一个版本: # i58
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty
这是mingw的一个版本:
# i586-mingw32msvc-g++ --version
i586-mingw32msvc-g++ (GCC) 4.2.1-sjlj (mingw32-2)
我下载了Boost 1.50版。
我尝试构建它:
echo "using gcc : 4.2 : i586-mingw32msvc-g++ ;" > user-config.jam
./bootstrap.sh
./b2 --user-config=user-config.jam \
--with-thread \
--with-system \
-sNO_BZIP2=1 \
-sNO_ZLIB=1 \
--layout=tagged \
--build-type=complete \
link=static,shared \
runtime-link=static,shared \
threading=single,multi \
toolset=gcc \
target-os=windows \
address-model=32 \
release stage
之后:
# pwd
/usr/src/boost_1_50_0/stage/lib
# ls -1
libboost_system-mt-s.a
libboost_system-mt.a
libboost_system-mt.dll
libboost_system-mt.dll.a
libboost_system-s.a
libboost_system.a
libboost_system.dll
libboost_system.dll.a
为什么我不能构建“boost\u thread\u win32-mt-s”或其他“boost\u thread\u XXX”?我解决了这个问题。我忘了提到Win的线程模型(threadapi=win32) 解决方案:
echo "using gcc : 4.2 : i586-mingw32msvc-g++ ;" > user-config.jam
./bootstrap.sh
./b2 --user-config=user-config.jam \
--with-thread \
--with-system \
-sNO_BZIP2=1 \
-sNO_ZLIB=1 \
--layout=tagged \
--build-type=complete \
link=static,shared \
runtime-link=static,shared \
threading=single,multi \
toolset=gcc \
target-os=windows \
threadapi=win32 \
address-model=32 \
release stage
谢谢