0

我未能在 Mac OS X 10.7.2 上构建 libjingle。当我 $path_to_swtoolkit/hammer.sh根据 libjingle 的 README 运行时,输出如下。

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.

我确定我的 Mac 中存在string.h,assert.h等等。我也尝试cd到该目录expat-2.0.1并运行./configureand make,并且成功了。我已经在网上搜索过这个问题,但对我来说似乎没什么用。所以,如果你知道为什么,谢谢你告诉我!

PS我的问题似乎是这样的:http ://groups.google.com/group/googletestframework/browse_thread/thread/e8ed5a3f410b7ec7/a8ba72e727801fc8?show_docid=a8ba72e727801fc8

4

3 回答 3

5

我对狮子也有同样的问题。正如wayon 指出的那样,开发人员似乎对特定的 SDK 版本“/Developer/SDKs/MacOSX10.5.sdk”进行了硬编码。截至发帖时,最新版本是 Xcode 4 附带的 10.7。在修复了构建中存在的其他几个问题后,我不确定它们是否与 OS X 或只是一个损坏的构建脚本有关对于 lib 叮当声。

这是修复我发现的其他问题的补丁libjingle patch。此外,您可能必须通过stackoverflow swtoolkit fix修复 swtoolkit 。

我还没有检查单元测试是否通过,但至少现在可以编译。

于 2011-11-26T00:09:00.650 回答
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
...
于 2012-01-28T08:09:45.017 回答
2

我遇到过同样的问题。

在我的情况下,问题是由目录“talk”(源代码树的顶层)中的 main.scons 文件中的错误 CCFLAGS 引起的。“-isysroot”参数的路径错误:

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

'-fasm-blocks', ],

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

所以,我只是将 4.0 替换为 5.0 并得到以下内容:

CCFLAGS = ['-arch', 'i386', '-isysroot', '/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk ' , '-fasm-blocks', ],

它对我有帮助。

要解决此问题,请尝试以下操作:

  1. 检查文件夹 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ 中的 sdk 版本
  2. 在源代码树顶部的 main.scons 文件中为 -isysroot 参数设置一个适当的路径(在我的例子中是 ilibjingle/gtalk/libjingle-0.5/talk):

然后尝试再次运行 $path_to_swtoolkit/hammer.sh。

我希望它会帮助你。

于 2011-11-25T18:58:57.463 回答