MySQL Forums
Forum List  »  Connector/C++

Re: Link error
Posted by: Luis Silva
Date: June 22, 2022 08:01AM

Hi!

Just did a quick test and got that error if no -lresolv, but worked with -lresolv:


root@d51a50239a48:~# g++ main.cc -I /usr/include/mysql-cppconn-8/ -lmysqlcppconn8-static -lssl -lcrypto -lpthread
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libmysqlcppconn8-static.a(libcdk_foundation_socket_detail.cc.o): in function `cdk::foundation::connection::detail::srv_list(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(.text+0x9b2): undefined reference to `__res_nsearch'
/usr/bin/ld: (.text+0x9fa): undefined reference to `ns_initparse'
/usr/bin/ld: (.text+0xa5a): undefined reference to `ns_parserr'
/usr/bin/ld: (.text+0xac8): undefined reference to `__dn_expand'
collect2: error: ld returned 1 exit status
root@d51a50239a48:~# g++ main.cc -I /usr/include/mysql-cppconn-8/ -lmysqlcppconn8-static -lssl -lcrypto -lpthread -lresolv
root@d51a50239a48:~#


Have you installed the 20.04 connector?

can you post the full command line?

PS: tested on a docker image, so basically the same environment...

Options: ReplyQuote


Subject
Views
Written By
Posted
676
June 21, 2022 07:52PM
Re: Link error
328
June 22, 2022 08:01AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.