ошибка при сборке libjingle в Mac OS X 10.7.2, например: «error: string.h: такого файла или каталога нет» - PullRequest
0 голосов
/ 07 ноября 2011

Мне не удалось собрать libjingle на Mac OS X 10.7.2. Вывод был следующим, когда я запускаю $path_to_swtoolkit/hammer.sh в соответствии с README из libjingle.

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.h, assert.h и так далее на моем Mac. Я также попытался cd в каталог expat-2.0.1 и запустить ./configure и make, и все прошло успешно. Я искал в Интернете эту проблему, и она не кажется мне полезной. Так что, если вы знаете почему, спасибо, что сказали мне!

P.S Моя проблема, похоже, такая: http://groups.google.com/group/googletestframework/browse_thread/thread/e8ed5a3f410b7ec7/a8ba72e727801fc8?show_docid=a8ba72e727801fc8

Ответы [ 3 ]

5 голосов
/ 26 ноября 2011

У меня была такая же проблема со львом.Как указал Wayon, похоже, разработчики жестко закодировали конкретную версию SDK "/Developer/SDKs/MacOSX10.5.sdk".На момент публикации последней версией является 10.7, которая поставляется с Xcode 4. После исправления проблемы со сборкой, я не уверен, связаны ли они с OS X или просто сломанный скрипт сборкидля lib jingle.

Вот патч, который исправляет другие обнаруженные мной проблемы, libjingle patch .Кроме того, вам, вероятно, придется исправить swtoolkit с помощью stackoverflow исправления swtoolkit .

Я не проверял, проходят ли модульные тесты, но по крайней мере он сейчас компилируется.

2 голосов
/ 28 января 2012

Попробуйте добавить следующее включение в ваш файл 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
...
2 голосов
/ 25 ноября 2011

У меня была такая же проблема.

В моем случае проблема была вызвана неправильными CCFLAGS в файле main.scons в каталоге 'talk' (верхний уровень дерева исходных текстов). Был неверный путь для аргумента -isysroot:

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

- ФАПО-блоки », ]

На моем 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-блоки', ]

Это помогло мне.

Для решения проблемы попробуйте следующее:

  1. Проверьте, какая версия SDK у вас есть в папке /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/
  2. Установите соответствующий путь для аргумента -isysroot в файле main.scons в верхней части дерева исходного кода (в моем случае это ilibjingle / gtalk / libjingle-0.5 / talk):

Затем попробуйте снова запустить $ path_to_swtoolkit / hammer.sh.

Надеюсь, это вам поможет.

...