2011-11-07 141 views
0

我無法在Mac OS X 10.7.2上構建libjingle。根據libjingle的自述文件運行$path_to_swtoolkit/hammer.sh時輸出如下。在Mac OS X 10.7.2上構建libjingle時出錯,如「error:string.h:No such file or directory」

MBP17:talk rei25$ ~/Desktop/swtoolkit/hammer.sh 
scons: Reading SConscript files ... 

scons: warning: The build_dir keyword has been deprecated; use the variant_dir keyword instead. 
File "/Users/rei25/Desktop/swtoolkit/site_scons/site_init.py", line 203, in BuildEnvironmentSConscripts 
scons: done reading SConscript files. 
scons: Building targets ... 
________Compiling build/dbg/obj/third_party/expat-2.0.1/lib/xmlparse.o 
third_party/expat-2.0.1/lib/xmlparse.c:6:48: error: string.h: No such file or directory 
third_party/expat-2.0.1/lib/xmlparse.c:7:20: error: assert.h: No such file or directory 
In file included from third_party/expat-2.0.1/lib/xmlparse.c:24: 
third_party/expat-2.0.1/lib/expat.h:17:20: error: stdlib.h: No such file or directory 
cc1: warnings being treated as errors 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'parserCreate': 
third_party/expat-2.0.1/lib/xmlparse.c:719: warning: implicit declaration of function 'malloc' 
third_party/expat-2.0.1/lib/xmlparse.c:719: warning: incompatible implicit declaration of built-in function 'malloc' 
third_party/expat-2.0.1/lib/xmlparse.c:723: error: 'realloc' undeclared (first use in this function) 
third_party/expat-2.0.1/lib/xmlparse.c:723: error: (Each undeclared identifier is reported only once 
third_party/expat-2.0.1/lib/xmlparse.c:723: error: for each function it appears in.) 
third_party/expat-2.0.1/lib/xmlparse.c:724: error: 'free' undeclared (first use in this function) 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'parserInit': 
third_party/expat-2.0.1/lib/xmlparse.c:848: warning: implicit declaration of function 'memset' 
third_party/expat-2.0.1/lib/xmlparse.c:848: warning: incompatible implicit declaration of built-in function 'memset' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'XML_Parse': 
third_party/expat-2.0.1/lib/xmlparse.c:1543: warning: implicit declaration of function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c:1543: warning: incompatible implicit declaration of built-in function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'XML_GetBuffer': 
third_party/expat-2.0.1/lib/xmlparse.c:1627: warning: implicit declaration of function 'memmove' 
third_party/expat-2.0.1/lib/xmlparse.c:1627: warning: incompatible implicit declaration of built-in function 'memmove' 
third_party/expat-2.0.1/lib/xmlparse.c:1656: warning: incompatible implicit declaration of built-in function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'XML_GetParsingStatus': 
third_party/expat-2.0.1/lib/xmlparse.c:1750: warning: implicit declaration of function 'assert' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'storeRawNames': 
third_party/expat-2.0.1/lib/xmlparse.c:2009: warning: incompatible implicit declaration of built-in function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'doContent': 
third_party/expat-2.0.1/lib/xmlparse.c:2424: warning: implicit declaration of function 'memcmp' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'storeAtts': 
third_party/expat-2.0.1/lib/xmlparse.c:2922: warning: incompatible implicit declaration of built-in function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c:2931: warning: incompatible implicit declaration of built-in function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'addBinding': 
third_party/expat-2.0.1/lib/xmlparse.c:3039: warning: incompatible implicit declaration of built-in function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'lookup': 
third_party/expat-2.0.1/lib/xmlparse.c:5871: warning: incompatible implicit declaration of built-in function 'memset' 
third_party/expat-2.0.1/lib/xmlparse.c:5898: warning: incompatible implicit declaration of built-in function 'memset' 
third_party/expat-2.0.1/lib/xmlparse.c:5927: warning: incompatible implicit declaration of built-in function 'memset' 
third_party/expat-2.0.1/lib/xmlparse.c: In function 'poolGrow': 
third_party/expat-2.0.1/lib/xmlparse.c:6112: warning: incompatible implicit declaration of built-in function 'memcpy' 
third_party/expat-2.0.1/lib/xmlparse.c:6148: warning: incompatible implicit declaration of built-in function 'memcpy' 
scons: *** [build/dbg/obj/third_party/expat-2.0.1/lib/xmlparse.o] Error 1 
scons: building terminated because of errors. 

我肯定的string.hassert.h存在等都在我的Mac。 我也試過cd到目錄expat-2.0.1並運行./configuremake,併成功。 我在網上搜索了這個問題,對我來說似乎沒有用。所以,如果你知道爲什麼,謝謝你告訴我!

P.S我的問題似乎是像這樣的:http://groups.google.com/group/googletestframework/browse_thread/thread/e8ed5a3f410b7ec7/a8ba72e727801fc8?show_docid=a8ba72e727801fc8

回答

2

我有同樣的問題。

在我的情況下,問題是由目錄'talk'(源樹的頂層)的main.scons文件中錯誤的CCFLAGS引起的。 有關於 '-isysroot' 參數錯誤路徑:

CCFLAGS = [ '-arch', 'I386', '-isysroot',「/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ iPhoneSimulator4.0.sdk」,

'-fasm塊', ],

有沒有iPhoneSimulator4.0.sdk我的Mac上,只有iPhoneSimulator4.3.sdk和iPhoneSimulator5.0。 SDK。

所以,我剛剛更換4.0〜5.0,得到了以下幾點:

CCFLAGS = [ '-arch', '386', '-isysroot',「/Developer/Platforms/iPhoneSimulator.platform/開發商/軟件開發工具包/ iPhoneSimulator5.0.sdk」, '-fasm塊', ],

它幫助我。

要解決此問題請嘗試以下操作:

  1. 檢查什麼版本的SDK的你已經得到的文件夾/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
  2. 中設置一個適當的路徑對於在源代碼樹的頂部main.scons文件-isysroot參數(在我的情況下,它ilibjingle/GTALK /設的Libjingle-0.5 /通話):

然後嘗試再次運行$ path_to_swtoolkit/hammer.sh。

我希望它能幫助你。

+0

謝謝,這幫助了我,我沒有6.1的SDK安裝或者這是目標SDK在使用的腳本中。 –

5

我和獅子有同樣的問題。正如wayon指出的那樣,開發人員對特定SDK版本「/Developer/SDKs/MacOSX10.5.sdk」進行了硬編碼。截至發佈時,Xcode 4附帶的最新版本是10.7。修復之後,還有一些與構建有關的其他問題,我不確定它們是否與OS X相關,或者只是一個破損的構建腳本爲lib叮噹。

下面是修復了我發現的其他問題的補丁:libjingle patch。 另外,您可能需要通過stackoverflow swtoolkit fix修復swtoolkit。

我還沒有檢查過,如果單元測試通過,但至少現在編譯。

2

嘗試添加以下到您的main.scons文件:

main.scons:

... // more than 300 lines and the you will find the mac_env section 

mac_env.Append(
    CPPDEFINES = [ 
    'OSX', 
    ], 
    CCFLAGS = [ 
    '-m32', 
    '-arch', 'i386', 
    '-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', 
    '-fasm-blocks', 
    '-I/usr/include', <--- Add this line and this will tell to scons where is your includes 
... 
相關問題