2011-11-07 142 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 
... 
相关问题