jean-airoldie / zeromq-src-rs

Source code and logic to build ZeroMQ from source
MIT License
11 stars 14 forks source link

Support `libsodium-sys` linking for windows builds #12

Closed jean-airoldie closed 2 years ago

jean-airoldie commented 5 years ago

Currently libsodium-sys cannot be linked to zeromq-src for some reason. We get linking errors:

 = note: zmq.lib(random.obj) : error LNK2019: unresolved external symbol __imp_sodium_init referenced in function "void __cdecl zmq::random_open(void)" (?random_open@zmq@@YAXXZ)
          zmq.lib(random.obj) : error LNK2019: unresolved external symbol __imp_randombytes_close referenced in function "void __cdecl zmq::random_close(void)" (?random_close@zmq@@YAXXZ)
          zmq.lib(zmq_utils.obj) : error LNK2019: unresolved external symbol __imp_crypto_box_keypair referenced in function zmq_curve_keypair
          zmq.lib(curve_client.obj) : error LNK2001: unresolved external symbol __imp_crypto_box_keypair
          zmq.lib(curve_server.obj) : error LNK2001: unresolved external symbol __imp_crypto_box_keypair
          zmq.lib(zmq_utils.obj) : error LNK2019: unresolved external symbol __imp_crypto_scalarmult_base referenced in function zmq_curve_public
          zmq.lib(curve_client.obj) : error LNK2019: unresolved external symbol __imp_crypto_box_beforenm referenced in function "public: virtual int __cdecl zmq::curve_client_t::process_handshake_command(class zmq::msg_t *)" (?process_handshake_command@curve_client_t@zmq@@UEAAHPEAVmsg_t@2@@Z)
          zmq.lib(curve_server.obj) : error LNK2001: unresolved external symbol __imp_crypto_box_beforenm
          zmq.lib(curve_client.obj) : error LNK2019: unresolved external symbol __imp_crypto_box referenced in function "public: virtual int __cdecl zmq::curve_client_t::next_handshake_command(class zmq::msg_t *)" (?next_handshake_command@curve_client_t@zmq@@UEAAHPEAVmsg_t@2@@Z)
          zmq.lib(curve_server.obj) : error LNK2001: unresolved external symbol __imp_crypto_box
          zmq.lib(curve_client.obj) : error LNK2019: unresolved external symbol __imp_crypto_box_open referenced in function "public: virtual int __cdecl zmq::curve_client_t::process_handshake_command(class zmq::msg_t *)" (?process_handshake_command@curve_client_t@zmq@@UEAAHPEAVmsg_t@2@@Z)
          zmq.lib(curve_server.obj) : error LNK2001: unresolved external symbol __imp_crypto_box_open
          zmq.lib(curve_client.obj) : error LNK2019: unresolved external symbol __imp_crypto_box_open_afternm referenced in function "private: int __cdecl zmq::curve_client_t::process_ready(unsigned char const *,unsigned __int64)" (?process_ready@curve_client_t@zmq@@AEAAHPEBE_K@Z)
          zmq.lib(curve_mechanism_base.obj) : error LNK2001: unresolved external symbol __imp_crypto_box_open_afternm
          zmq.lib(curve_client.obj) : error LNK2019: unresolved external symbol __imp_randombytes referenced in function "public: static int __cdecl zmq::curve_client_tools_t::produce_initiate(void *,unsigned __int64,unsigned __int64,unsigned char const *,unsigned char const *,unsigned char const *,unsigned char const *,unsigned char const *,unsigned char const *,unsigned char const *,unsigned char const *,unsigned __int64)" (?produce_initiate@curve_client_tools_t@zmq@@SAHPEAX_K_KPEBE33333332@Z)
          zmq.lib(curve_server.obj) : error LNK2001: unresolved external symbol __imp_randombytes
          zmq.lib(curve_server.obj) : error LNK2019: unresolved external symbol __imp_crypto_box_afternm referenced in function "private: int __cdecl zmq::curve_server_t::produce_ready(class zmq::msg_t *)" (?produce_ready@curve_server_t@zmq@@AEAAHPEAVmsg_t@2@@Z)
          zmq.lib(curve_mechanism_base.obj) : error LNK2001: unresolved external symbol __imp_crypto_box_afternm
          zmq.lib(curve_server.obj) : error LNK2019: unresolved external symbol __imp_crypto_secretbox referenced in function "public: virtual int __cdecl zmq::curve_server_t::next_handshake_command(class zmq::msg_t *)" (?next_handshake_command@curve_server_t@zmq@@UEAAHPEAVmsg_t@2@@Z)
          zmq.lib(curve_server.obj) : error LNK2019: unresolved external symbol __imp_crypto_secretbox_open referenced in function "private: int __cdecl zmq::curve_server_t::process_initiate(class zmq::msg_t *)" (?process_initiate@curve_server_t@zmq@@AEAAHPEAVmsg_t@2@@Z)
          C:\projects\zeromq-src-rs\target\debug\deps\testcrate-7f94c6d0802c5e26.exe : fatal error LNK1120: 12 unresolved externals
jean-airoldie commented 2 years ago

Seems to be fixed as of #17.