加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – “编译器线程支持未打开.”

发布时间:2020-12-13 19:36:55 所属栏目:Linux 来源:网络整理
导读:通常情况下,我可以通过google方式找到解决方案,但这次不是. 我正在使用64位Linux Ubuntu 11.04来编译32位Windows应用程序.我正在使用i586-mingw32msvc-gcc来编译我的C文件. TEST.CPP: #include 生成文件: i586-mingw32msvc-gcc -c -m32 -mthreads -o test.

通常情况下,我可以通过google方式找到解决方案,但这次不是.

我正在使用64位Linux Ubuntu 11.04来编译32位Windows应用程序.我正在使用i586-mingw32msvc-gcc来编译我的C文件.

TEST.CPP:

#include 

生成文件:

i586-mingw32msvc-gcc -c -m32 -mthreads -o test.o test.cpp

错误:

boost/asio/detail/socket_types.hpp:
# include 

添加到makefile:-DBOOST_WINDOWS

Error:
#   warning Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately

好的,添加到makefile:-D_WIN32_WINNT = 0x0501

Error:
#   error "Compiler threading support is not turned on. Please set the correct command line options for threading: -pthread (Linux),-pthreads (Solaris) or -mthreads (Mingw32)"

但我确实指定了-mthreads.

最佳答案
添加-DBOOST_HAS_THREADS可能就足够了(参见offending header中#elif定义的__GNUC__).但是,您的boost安装可能/可能是为了支持您的构建环境而不是您的目标.使用交叉编译工具链尝试building it yourself.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读