【问题标题】:error at building libjingle on Mac OS X 10.7.2 like "error: string.h: No such file or directory"在 Mac OS X 10.7.2 上构建 libjingle 时出错,例如“error: string.h: No such file or directory”
【发布时间】:2011-11-07 12:35:17
【问题描述】:

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

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.hassert.h 等。 我也试过cd到目录expat-2.0.1并运行./configuremake,成功了。 我已经在网上搜索过这个问题,但对我来说似乎没什么用。所以,如果你知道为什么,谢谢你告诉我!

P.S 我的问题好像是这样的:http://groups.google.com/group/googletestframework/browse_thread/thread/e8ed5a3f410b7ec7/a8ba72e727801fc8?show_docid=a8ba72e727801fc8

【问题讨论】:

    标签: macos swt scons libjingle expat-parser


    【解决方案1】:

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

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

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

    【讨论】:

      【解决方案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。

      希望对你有帮助。

      【讨论】:

      • 谢谢,这对我有帮助,我也没有安装 6.1 SDK,这是使用的脚本中的目标 SDK。
      【解决方案3】:

      尝试将以下包含添加到您的 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
      ...
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2022-07-11
        • 1970-01-01
        • 2012-06-03
        • 2019-07-23
        • 2023-04-03
        • 2016-11-01
        相关资源
        最近更新 更多