weinzierl-engineering / baos

BAOS SDK - http://weinzierl-engineering.github.io/baos
MIT License
40 stars 18 forks source link

Compile sample error "undefined reference to kdrive" #13

Closed henzycuong1 closed 2 years ago

henzycuong1 commented 4 years ago

/home/henzycuong1/knxTest/main.cpp:32: error: undefined reference to kdrive::utility::LoggerFormatter::LoggerFormatter()' :-1: error: /home/henzycuong1/build-knxTest-Desktop_Qt_5_12_5_GCC_64bit-Debug/../knxTest/main.cpp:32: undefined reference to kdrive::utility::LoggerFormatter::initRootConsoleLogger()' :-1: error: /home/henzycuong1/build-knxTest-Desktop_Qt_5_12_5_GCC_64bit-Debug/../knxTest/main.cpp:37: undefined reference to kdrive::baos::BaosIpEnumerator::getDevices[abi:cxx11]() const' :-1: error: /home/henzycuong1/build-knxTest-Desktop_Qt_5_12_5_GCC_64bit-Debug/../knxTest/main.cpp:44: undefined reference to kdrive::baos::BaosIpEnumerator::getName(std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned char> const&) const' :-1: error: /home/henzycuong1/build-knxTest-Desktop_Qt_5_12_5_GCC_64bit-Debug/../knxTest/main.cpp:45: undefined reference to kdrive::baos::BaosIpEnumerator::getInterfaceAddress(std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned char> const&) const'

File: BaosIpEnumerator.cpp

Software: Qt 5.12.5

Sorry, my English's bad. How to fix the error? Do you want more information about this?

henzycuong1 commented 4 years ago

I have fixed that problem, but some new problems were shown. May someone help me? /usr/local/include/Poco/Format.h:172: error: undefined reference toPoco::format(std::cxx11::basic_string<char, std::char_traits, std::allocator >&, char const*, std::vector<Poco::Any, std::allocator > const&)' /usr/local/include/Poco/Format.h:172: error: undefined reference to `Poco::format(std::cxx11::basic_string<char, std::char_traits, std::allocator >&, char const*, std::vector<Poco::Any, std::allocator > const&)' :-1: error: main.o:(.data.rel.ro._ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE[_ZTVN4Poco3Net4Impl21IPv6SocketAddressImplE]+0x50): undefined reference to Poco::Net::Impl::IPv6SocketAddressImpl::toString[abi:cxx11]() const'

weinzierl-engineering commented 4 years ago

It looks like your linker settings are not correct. Did you follow the instructions in README.adoc section compiling? What is your os?

henzycuong1 commented 4 years ago

It looks like your linker settings are not correct. Did you follow the instructions in README.adoc section compiling? What is your os?

It has been fixed. The header file wasn't linked exactly. I copied all header files of the third party folder into my project. Thus, it has been working. Thank you for your reply.