Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/163.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 在cygwin上编译android boost时无法识别的命令行选项_C++_Boost_Cygwin - Fatal编程技术网

C++ 在cygwin上编译android boost时无法识别的命令行选项

C++ 在cygwin上编译android boost时无法识别的命令行选项,c++,boost,cygwin,C++,Boost,Cygwin,我正试图在的帮助下在cygwin上编译boost 但当我运行以下语句时 bjam --without-python --without-serialization toolset=gcc-android4.4.3 link=static runtime-link=static target-os=linux --stagedir=android 它已开始编译,但由于以下错误而失败: cc1plus.exe: error: unrecognized command line option "-m

我正试图在的帮助下在cygwin上编译boost

但当我运行以下语句时

bjam --without-python --without-serialization toolset=gcc-android4.4.3 link=static runtime-link=static target-os=linux --stagedir=android
它已开始编译,但由于以下错误而失败:

cc1plus.exe: error: unrecognized command line option "-mthreads"
我正在使用最新的cygwin和boost 1.48.0

如果有人能给我一个提示来消除这个错误,我将不胜感激

更新:

我找到了解决办法。Boost假设cygwin拥有MingW gcc编译器,因此在我删除该选项后,它在配置文件“gcc.jam”中添加了该特殊选项,并正常运行。

Short

target os=android
传递到
b2

解释

对于Boost 1.59,我也面临同样的问题

根据
boost/tools/build/src/tools/gcc.jam
第1024行

rule setup-threading ( targets * : sources * : properties * )
{
    local threading = [ feature.get-values threading : $(properties) ] ;
    if $(threading) = multi
    {
        local target = [ feature.get-values target-os : $(properties) ] ;
        local option ;
        local libs ;

        switch $(target)
        {
            case android : # No threading options, everything is in already.
            case windows : option = -mthreads ;
            case cygwin  : option = -mthreads ;
            case solaris : option = -pthreads ; libs = rt ;
            case beos    : # No threading options.
            case haiku   : option = ;
            case *bsd    : option = -pthread ;  # There is no -lrt on BSD.
            case sgi     : # gcc on IRIX does not support multi-threading.
            case darwin  : # No threading options.
            case *       : option = -pthread ; libs = rt ;
        }

        if $(option)
        {
            OPTIONS on $(targets) += $(option) ;
        }
        if $(libs)
        {
            FINDLIBS-SA on $(targets) += $(libs) ;
        }
    }
}

如您所见,
-mthreads
取决于
目标操作系统
参数

,您可以回答并接受自己的问题。我想在stackoverflow允许您这样做之前,您必须等待一段时间。