2011-11-25 158 views
5

编译提升为Android我试图编译在cygwin的提升与following article无法识别的命令行选项,而在Cygwin的

帮助,但,当我跑下面的语句

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,促进1.48.0

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

更新:

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

+0

没关系为你解答,接受你自己的问题。我认为你必须等待一段时间才能使用stackoverflow。 –

回答

0

通行证target-os=androidb2

说明

我面临着同样的问题,为加速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取决于target-os PARAM

相关问题