【问题标题】:file not found: /usr/lib/system/libdnsinfo.dylib for architecture i386找不到文件:架构 i386 的 /usr/lib/system/libdnsinfo.dylib
【发布时间】:2013-12-03 09:19:51
【问题描述】:

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

我正在尝试使用编译 pycrypto-2.1.0 python setup.py 构建并出现以下错误

-------------------------------------------------- -------------------------- 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 用于架构 i386 collect2: ld 返回 1 个退出状态 ld:找不到文件:/usr/lib/system/libdnsinfo.dylib 用于架构 x86_64 collect2: ld 返回 1 个退出状态 -------------------------------------------------- ----------------------------------

定位给了

$ 定位 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 用于架构 i386 collect2: ld 返回 1 个退出状态 ld:找不到文件:/usr/lib/system/libdnsinfo.dylib 用于架构 x86_64

collect2: ld 返回 1 个退出状态

有办法解决这个问题吗?

【问题讨论】:

  • 我认为您正在为 iPhone 模拟器构建它。尝试将目标从模拟器更改为 iOS 设备
  • @Ernaidu:我的目的是为 iOS 设备构建这个,我没有为 iPhone 更改它。怎么改,目标?
  • 不,伙计,我告诉你,在左上角我们有 device family 。在那里你必须选择它
  • @Emaidu我不在模拟器上,正在使用 OS shell 和构建
  • XCode升级到5.0.1后问题解决

标签: python ios xcode macos pycrypto


【解决方案1】:

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

对我有用的快速解决方案是将其中一个 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

【讨论】:

    【解决方案2】:

    在eclipse中遇到同样的问题 以下对我有用:

    1) 查找库的位置

     locate libdnsinfo.dynlib
    

    2) 复制并粘贴位置到

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

    【讨论】:

      【解决方案3】:

      改用 libdns_services,最新的 sdk 不再支持 libdnsinfo.dylib。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-10-06
        • 2012-04-11
        • 2016-04-16
        • 2017-10-23
        • 2012-12-29
        • 1970-01-01
        • 2015-06-11
        相关资源
        最近更新 更多