viabtc / viabtc_exchange_server

A trading engine with high-speed performance and real-time notification
MIT License
2.68k stars 1.49k forks source link

I get this error while compiling ,can anybody help me out of this #68

Open AddBean opened 6 years ago

AddBean commented 6 years ago

gcc -g -rdynamic -o marketprice.exe mp_message.o mp_config.o mp_main.o mp_kline.o mp_server.o -L ../utils -lutils -L ../network -lnetwork -Wl,-Bstatic -lev -ljansson -lmpdec -lrdkafka -lz -lssl -lcrypto -lhiredis -lcurl -Wl,-Bdynamic -lm -lpthread -ldl //usr/local/lib/libcurl.a(libcurl_la-md5.o): In function Curl_md5it': md5.c:(.text+0x22): undefined reference toMD5_Init' md5.c:(.text+0x3f): undefined reference to MD5_Update' md5.c:(.text+0x4a): undefined reference toMD5_Final' //usr/local/lib/libcurl.a(libcurl_la-md5.o):(.data.rel.ro+0x0): undefined reference to MD5_Init' //usr/local/lib/libcurl.a(libcurl_la-md5.o):(.data.rel.ro+0x8): undefined reference toMD5_Update' //usr/local/lib/libcurl.a(libcurl_la-md5.o):(.data.rel.ro+0x10): undefined reference to MD5_Final' //usr/local/lib/libcurl.a(libcurl_la-md5.o):(.data.rel.ro+0x20): undefined reference toMD5_Init' //usr/local/lib/libcurl.a(libcurl_la-md5.o):(.data.rel.ro+0x28): undefined reference to MD5_Update' //usr/local/lib/libcurl.a(libcurl_la-md5.o):(.data.rel.ro+0x30): undefined reference toMD5_Final' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_sha256sum': openssl.c:(.text+0x11a): undefined reference toSHA256_Init' openssl.c:(.text+0x128): undefined reference to SHA256_Update' openssl.c:(.text+0x133): undefined reference toSHA256_Final' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_md5sum': openssl.c:(.text+0x187): undefined reference toMD5_Init' openssl.c:(.text+0x195): undefined reference to MD5_Update' openssl.c:(.text+0x1a0): undefined reference toMD5_Final' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_engines_list': openssl.c:(.text+0x1d5): undefined reference toENGINE_get_first' openssl.c:(.text+0x1f7): undefined reference to ENGINE_get_next' openssl.c:(.text+0x207): undefined reference toENGINE_get_id' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_set_engine': openssl.c:(.text+0x268): undefined reference toENGINE_by_id' openssl.c:(.text+0x285): undefined reference to ENGINE_finish' openssl.c:(.text+0x291): undefined reference toENGINE_free' openssl.c:(.text+0x2a4): undefined reference to ENGINE_init' openssl.c:(.text+0x2dc): undefined reference toENGINE_free' openssl.c:(.text+0x2e1): undefined reference to ERR_get_error' openssl.c:(.text+0x2f1): undefined reference toERR_error_string_n' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_close_all': openssl.c:(.text+0x364): undefined reference toENGINE_finish' openssl.c:(.text+0x370): undefined reference to ENGINE_free' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In functionossl_recv': openssl.c:(.text+0x3d3): undefined reference to ERR_clear_error' openssl.c:(.text+0x400): undefined reference toSSL_read' openssl.c:(.text+0x44f): undefined reference to SSL_get_error' openssl.c:(.text+0x468): undefined reference toERR_get_error' openssl.c:(.text+0x4f0): undefined reference to ERR_error_string_n' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In functionssl_ui_writer': openssl.c:(.text+0x880): undefined reference to UI_get_string_type' openssl.c:(.text+0x890): undefined reference toUI_get0_user_data' openssl.c:(.text+0x89d): undefined reference to UI_get_input_flags' openssl.c:(.text+0x8a6): undefined reference toUI_OpenSSL' openssl.c:(.text+0x8ae): undefined reference to UI_method_get_writer' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In functionssl_ui_reader': openssl.c:(.text+0x8de): undefined reference to UI_get_string_type' openssl.c:(.text+0x8ee): undefined reference toUI_get0_user_data' openssl.c:(.text+0x8fe): undefined reference to UI_get_input_flags' openssl.c:(.text+0x907): undefined reference toUI_OpenSSL' openssl.c:(.text+0x90f): undefined reference to UI_method_get_reader' openssl.c:(.text+0x92a): undefined reference toUI_set_result' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function pubkey_show': openssl.c:(.text+0x98d): undefined reference toBN_print' openssl.c:(.text+0x9a1): undefined reference to BIO_ctrl' openssl.c:(.text+0x9c8): undefined reference toBIO_ctrl' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_data_pending': openssl.c:(.text+0xa12): undefined reference toSSL_pending' openssl.c:(.text+0xa37): undefined reference to SSL_pending' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In functionCurl_ossl_shutdown': openssl.c:(.text+0xac8): undefined reference to ERR_clear_error' openssl.c:(.text+0xae5): undefined reference toSSL_read' openssl.c:(.text+0xaf7): undefined reference to SSL_get_error' openssl.c:(.text+0xb1f): undefined reference toERR_get_error' openssl.c:(.text+0xb84): undefined reference to SSL_free' openssl.c:(.text+0xbed): undefined reference toSSL_get_shutdown' openssl.c:(.text+0xcbc): undefined reference to ERR_error_string_n' openssl.c:(.text+0xcf9): undefined reference toSSL_shutdown' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_version': openssl.c:(.text+0xe07): undefined reference toSSLeay' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function ossl_send': openssl.c:(.text+0xf21): undefined reference toERR_clear_error' openssl.c:(.text+0xf4e): undefined reference to SSL_write' openssl.c:(.text+0xf9e): undefined reference toSSL_get_error' openssl.c:(.text+0xfbc): undefined reference to ERR_get_error' openssl.c:(.text+0xfe9): undefined reference toERR_error_string_n' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In function Curl_ossl_cleanup': openssl.c:(.text+0x10f5): undefined reference toEVP_cleanup' openssl.c:(.text+0x10fa): undefined reference to ENGINE_cleanup' openssl.c:(.text+0x10ff): undefined reference toERR_free_strings' openssl.c:(.text+0x1106): undefined reference to ERR_remove_thread_state' openssl.c:(.text+0x110b): undefined reference toCONF_modules_free' openssl.c:(.text+0x1110): undefined reference to SSL_COMP_free_compression_methods' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In functionCurl_ossl_set_engine_default': openssl.c:(.text+0x1160): undefined reference to ENGINE_set_default' openssl.c:(.text+0x1170): undefined reference toENGINE_get_id' openssl.c:(.text+0x1199): undefined reference to ENGINE_get_id' //usr/local/lib/libcurl.a(libcurl_la-openssl.o): In functionossl_close.isra.2': openssl.c:(.text+0x11d1): undefined reference to `SSL_shutdown'

PoeticBear commented 6 years ago

Change your configuration to

”gcc -g -rdynamic -o marketprice.exe mp_message.o mp_config.o mp_main.o mp_kline.o mp_server.o -L ../utils -lutils -L ../network -lnetwork -Wl,-Bstatic -lev -ljansson -lmpdec -lrdkafka -lz -lssl -lcrypto -lhiredis -Wl,-Bdynamic -lcurl -lm -lpthread -ldl“

skys215 commented 6 years ago

Add -lcurl at the end of the compile command.

cyppper commented 6 years ago

if you still have any trouble, feel free to write me in telegram: @lspidh

ilanoh commented 6 years ago

You just changed the place at which you place -lcurl ? Why does this have any matter with the compilation ? @AddBean Were you able to resolve the issue ? @PoeticBear @skys215 I get somewhat the same error, with a lot of undefined references, no matter where I place the -lcurl. I think it may be reated to the fact that gcc don't link some libraries related to C++, but cannot find the solution at the moment.

skys215 commented 6 years ago

My files was removed. I'm not sure, but I also added some more option while compiling, like -lrd+ or something. But I end up with using this docker image. Compiling this project by your own is such a pain.

ilanoh commented 6 years ago

@skys215 Can we talk in private on gitter on telegram or else ?

cyppper commented 6 years ago

@ilanoh you can pm me in telegram @lspidh, i will help you

felix021 commented 6 years ago

@AddBean detailed compilation guide: https://www.felix021.com/blog/read.php?2187

lealife commented 6 years ago

I have run it on Centos successfully, Please see https://github.com/lealife/viabtc_exchange_server/issues/1

ilanoh commented 6 years ago

@lealife thanks I will check this out this weekend, were you able to play with the API as well?

AbhilashSunkad commented 4 years ago

I am getting the same above error. I am building libcurl for android. I have linked the crypto,openssl and curl library. Below are the libraries linking. libssl.a libcrypto.a libcurl.a I am compiling on Mac OS. Not getting what to do next.