HuobiRDCenter/huobi_Cpp

during make, prompted error with the 3rdparity libraries.

vesslanjin opened this issue · 5 comments

I think you should re-comile the 3rdparity library with -fPIC option.

[100%] Linking CXX executable unittest
/usr/bin/ld: ../../3rdparty/libdecnumber/lib/libdecnumber.a(decContext.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../3rdparty/libdecnumber/lib/libdecnumber.a(decDouble.o): relocation R_X86_64_32S against symbol DPD2BIN' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../3rdparty/libdecnumber/lib/libdecnumber.a(decQuad.o): relocation R_X86_64_32S against symbol `DPD2BIN' can not be used when making a PIE object; recompile with -fPIC

Thanks for your feedback.
I am looking on this. The current libraries are only for CentOS
I will modify the installation step, so that you can install the 3rd party lib by yourself to support different linux version.

Thanks,
Best regards,

thanks for reply. I see, i used ubuntu.

unfortunately, on Centos 7.5 also failed.

main.cpp:(.text+0x76b1): undefined reference to lws_snprintf' CMakeFiles/unittest.dir/main.cpp.o: In function Huobi::ApiSignature::CreateSignature(std::string, std::string, std::string, std::string, std::string, char*, char const*)':
main.cpp:(.text._ZN5Huobi12ApiSignature15CreateSignatureESsSsSsSsSsPcPKc[_ZN5Huobi12ApiSignature15CreateSignatureESsSsSsSsSsPcPKc]+0x2ef): undefined reference to HMAC_CTX_new' main.cpp:(.text._ZN5Huobi12ApiSignature15CreateSignatureESsSsSsSsSsPcPKc[_ZN5Huobi12ApiSignature15CreateSignatureESsSsSsSsSsPcPKc]+0x34c): undefined reference to HMAC_CTX_free'
../../3rdparty/gtest/lib/libgtest.a(gtest-all.cc.o): In function std::vector<testing::TestPartResult, std::allocator<testing::TestPartResult> >::_M_range_check(unsigned long) const': gtest-all.cc:(.text._ZNKSt6vectorIN7testing14TestPartResultESaIS1_EE14_M_range_checkEm[_ZNKSt6vectorIN7testing14TestPartResultESaIS1_EE14_M_range_checkEm]+0x48): undefined reference to std::__throw_out_of_range_fmt(char const*, ...)'
../../3rdparty/gtest/lib/libgtest.a(gtest-all.cc.o): In function std::vector<testing::TestProperty, std::allocator<testing::TestProperty> >::_M_range_check(unsigned long) const': gtest-all.cc:(.text._ZNKSt6vectorIN7testing12TestPropertyESaIS1_EE14_M_range_checkEm[_ZNKSt6vectorIN7testing12TestPropertyESaIS1_EE14_M_range_checkEm]+0x48): undefined reference to std::__throw_out_of_range_fmt(char const*, ...)'
collect2: error: ld returned 1 exit status
make[2]: *** [unittest/unittest] Error 1
make[1]: *** [unittest/CMakeFiles/unittest.dir/all] Error 2
make: *** [all] Error 2

I think this is still the compatibility issue, we are looking this.
Thanks,
Best regards,

does this veriosn have any special depend on g++ version ? on my centos 7.5.1804, I successfully get a libHuobiClient.a, but when I tried to compile the example, it failed with below message:

ClientCreator.cpp:(.text+0xabc): undefined reference to std::regex_token_iterator<char const*, char, std::regex_traits >::regex_token_iterator(char const*, char const*, std::basic_regex<char, std::regex_traits > const&, int, std::bitset<11ul>)' ClientCreator.cpp:(.text+0xac9): undefined reference to std::regex_token_iterator<char const*, char, std::regex_traits >::regex_token_iterator()'

it seems my g++ doesn't support regex stuff, and I added -std=c++11 option already

the g++ version I have is gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)