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

通常情况下,我可以通过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.

相关文章

在Linux上编写运行C语言程序,经常会遇到程序崩溃、卡死等异...
git使用小结很多人可能和我一样,起初对git是一无所知的。我...
1. 操作系统环境、安装包准备 宿主机:Max OSX 10.10.5 虚拟...
因为业务系统需求,需要对web服务作nginx代理,在不断的尝试...
Linux模块机制浅析 Linux允许用户通过插入模块,实现干预内核...
一、Hadoop HA的Web页面访问 Hadoop开启HA后,会同时存在两个...