2015-04-10 1 views
9

Je construis zeromq bibliothèque pour iOS à l'aide de cette méthode: https://github.com/drewcrawford/libzmq-ioszeromq Build pour iOS avec libsodium, randombytes erreur

Le journal de la construction semble bien sauf quelques avertissements qui apparaissent 3 fois:

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); 
     ^

Quand j'ajouter à mon bibliothèque rebâti projet XCode, il génère 10 erreurs:

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) 

Je pense que toutes les fonctions, figurant dans l'e rrors, utilise randombytes, qui était listé dans warning.

La même chose arrive quand j'ajoute la bibliothèque de https://github.com/drewcrawford/libzmq-ios/releases

Ce que je fais mal?

+0

Ce sont les erreurs de liaison. Checkout le fichier lib qui contient ces symboles fournis. par exemple. libsodium.a – douyw

Répondre

0

On dirait que vous n'êtes pas il seul avec ce (ou similaire) numéro: https://github.com/drewcrawford/libzmq-ios/issues/4

À partir du lien: « Je suis en mesure de corriger ces erreurs par l'importation de la libC++ dylib dans mon projet. ». Leur problème était de répertorier l'architecture armv7 plutôt que, comme dans votre cas, l'architecture i386, mais c'est quelque chose à essayer.