2011-11-25 160 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

相關問題