找不到文件:/usr/lib/system/libdnsinfo.dylib for architecture i386

时间:2013-11-19 17:27:35

标签: python ios xcode macos pycrypto

我使用XCode 4.6.3使用MAC 10.9并安装了命令行工具

我正在尝试使用编译pycrypto-2.1.0 python setup.py构建并获得跟随错误


-----------------------------------------------------------------------------
ld: warning: ignoring file build/temp.macosx-10.6-intel-2.7/src/MD2.o, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 1 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): build/temp.macosx-10.6-intel-2.7/src/MD2.o
ld: file not found: /usr/lib/system/libdnsinfo.dylib for architecture i386
collect2: ld returned 1 exit status
ld: file not found: /usr/lib/system/libdnsinfo.dylib for architecture x86_64
collect2: ld returned 1 exit status
------------------------------------------------------------------------------------

找到正在给予

$ locate libdnsinfo.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/lib/system/libdnsinfo.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/system/libdnsinfo.dylib
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system/libdnsinfo.dylib

这些路径也会添加到PATH。

以下是命令和错误


$ python setup.py build 运行构建 运行build_py 运行build_ext 警告:未找到GMP库;没有构建Crypto.PublicKey._fastmath。 建立'Crypto.Hash.MD2'扩展 gcc-4.2 -I / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sdk / usr / include / -I / Applications / Xcode.app / Contents / Developer / Platforms /MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/ -I / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sdk / usr / include / c ++ / 4.2.1 / -O3 -fomit-frame-pointer -Isrc / -I / Library / Frameworks / Python.framework / Versions / 2.7 / include / python2.7 -c src / MD2.c -o build / temp.macosx-10.6-Intel的2.7 / SRC / MD2.o gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g -L / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sdk / usr / lib -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/ -I / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sdk / usr / include / -I / Applications / Xcode.app / Contents / Developer / Platforms / MacOSX.platform / Developer / SDKs / MacOSX10.7.sdk / usr / include / c ++ / 4.2 .1 / build / temp.macosx-10.6-intel-2.7 / src / MD2.o -o build / lib.macosx-10.6-intel-2.7 / Crypto / Hash / MD2.so ld:警告:忽略文件build / temp.macosx-10.6-intel-2.7 / src / MD2.o,文件是为不支持的文件格式构建的(0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 1 0x 0 0x 0 0x 0)这不是被链接的架构(i386):build / temp.macosx-10.6-intel-2.7 / src / MD2.o ld:找不到文件:/usr/lib/system/libdnsinfo.dylib for architecture i386 collect2:ld返回1退出状态 ld:找不到文件:/usr/lib/system/libdnsinfo.dylib for architecture x86_64

collect2:ld返回1退出状态

有什么想法解决这个问题吗?

3 个答案:

答案 0 :(得分:0)

我在尝试将openssl库链接到一个简单的c应用程序时升级到osx 10.9后也遇到了这个问题。

对我有用的快速解决方案是将其中一个libdnsinfo文件链接到/ usr / lib / system

例如:

ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/system/libdnsinfo.dylib /usr/lib/system/libdnsinfo.dylib

答案 1 :(得分:0)

在eclipse中遇到同样的问题 以下为我工作:

1)找到lib的位置

 locate libdnsinfo.dynlib

2)将位置复制并粘贴到

 project > properties > C/C++ Build > Settings > MacOS X C Linker > Libraries > Library Search Path

答案 2 :(得分:0)

使用libdns_services代替,最新的sdk不再支持libdnsinfo.dylib。