首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何用boost _thread_win32 32-mt-s构建boost(使用mingw进行交叉编译)

如何用boost _thread_win32 32-mt-s构建boost(使用mingw进行交叉编译)
EN

Stack Overflow用户
提问于 2017-11-24 18:11:44
回答 1查看 572关注 0票数 1

我不能用boost_thread_win32-mt-s).在上构建Boost (我不能创建MinGW )

这是操作系统的一个版本:

代码语言:javascript
复制
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:        14.04
Codename:       trusty

这是明明威的版本:

代码语言:javascript
复制
# i586-mingw32msvc-g++ --version
i586-mingw32msvc-g++ (GCC) 4.2.1-sjlj (mingw32-2)

我下载了Boost版本1.50。我试着建造它:

代码语言:javascript
复制
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

之后:

代码语言:javascript
复制
# 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_thread_win32-mt-s“或其他"boost_thread_XXX"?

EN

回答 1

Stack Overflow用户

发布于 2017-12-06 09:19:06

我解决了这个问题。我忘了提到Win的线程模型(threadapi=win32)。

解决方案:

代码语言:javascript
复制
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

谢谢!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47478300

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档