10

我正在使用这种方法为 iOS 构建 zeromq 库: https ://github.com/drewcrawford/libzmq-ios

构建日志看起来不错,除了一些出现 3 次的警告:

 CC crypto_scalarmult/curve25519/ref10/libsodium_la-fe_0_curve25519_ref10.lo
randombytes/salsa20/randombytes_salsa20_random.c:278:17: warning: comparison of constant 18446744073709551615 with expression of type
      'const size_t' (aka 'const unsigned long') is always true [-Wtautological-constant-out-of-range-compare]
    assert(size <= ULONG_LONG_MAX);
    ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/usr/include/assert.h:93:25: note:
      expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
randombytes/sysrandom/randombytes_sysrandom.c:202:17: warning: comparison of constant 18446744073709551615 with expression of type 'const size_t'
      (aka 'const unsigned long') is always true [-Wtautological-constant-out-of-range-compare]
    assert(size <= ULONG_LONG_MAX);
    ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/usr/include/assert.h:93:25: note:
      expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)


      CXX      libzmq_la-null_mechanism.lo
ipc_listener.cpp:127:24: warning: 'tempnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns
      inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
        char *tmpstr = tempnam (NULL, NULL);
                       ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.2.sdk/usr/include/stdio.h:391:7: note: 'tempnam'
      has been explicitly marked deprecated here
char    *tempnam(const char *, const char *) __DARWIN_ALIAS(tempnam);
         ^

当我将构建的库添加到我的 XCode 项目时,它会产生 10 个错误:

Undefined symbols for architecture i386:
  "_crypto_box", referenced from:
      zmq::curve_client_t::produce_hello(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_client_t::produce_initiate(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_server_t::produce_welcome(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
  "_crypto_box_afternm", referenced from:
      zmq::curve_client_t::encode(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_server_t::produce_ready(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
      zmq::curve_server_t::encode(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
  "_crypto_box_beforenm", referenced from:
      zmq::curve_client_t::process_welcome(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_server_t::process_initiate(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
  "_crypto_box_keypair", referenced from:
      _zmq_curve_keypair in libzmq.a(libzmq_la-zmq_utils.o)
      zmq::curve_client_t::curve_client_t(zmq::options_t const&) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_server_t::curve_server_t(zmq::session_base_t*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, zmq::options_t const&) in libzmq.a(libzmq_la-curve_server.o)
  "_crypto_box_open", referenced from:
      zmq::curve_client_t::process_welcome(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_server_t::process_hello(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
      zmq::curve_server_t::process_initiate(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
  "_crypto_box_open_afternm", referenced from:
      zmq::curve_client_t::process_ready(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_client_t::decode(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_server_t::decode(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
  "_crypto_secretbox", referenced from:
      zmq::curve_server_t::produce_welcome(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
  "_crypto_secretbox_open", referenced from:
      zmq::curve_server_t::process_initiate(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
  "_randombytes", referenced from:
      zmq::curve_client_t::produce_initiate(zmq::msg_t*) in libzmq.a(libzmq_la-curve_client.o)
      zmq::curve_server_t::produce_welcome(zmq::msg_t*) in libzmq.a(libzmq_la-curve_server.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我认为错误中列出的每个函数都使用警告中列出的随机字节。

当我从https://github.com/drewcrawford/libzmq-ios/releases添加库时也会发生同样的情况

我做错了什么?

4

1 回答 1

0

看起来你不是唯一一个有这个(或类似)问题的人:https ://github.com/drewcrawford/libzmq-ios/issues/4

从链接:“我能够通过将 libc++.dylib 导入我的项目来修复这些错误。” 他们的问题是列出 armv7 架构,而不是像您的情况那样列出 i386 架构,但这是值得尝试的。

于 2015-04-13T16:46:24.120 回答