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常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...