MySQL Forums
Forum List  »  Connector/C++

Static linking to Connector/C++ on linux giving errors
Posted by: Pelle Stormark
Date: April 08, 2020 09:19AM

I'm trying to link the static connector library using the following makefile:

MYSQL_CONCPP_DIR = /usr/include/mysql-cppconn-8
CPPFLAGS = -DSTATIC_CONCPP -I $(MYSQL_CONCPP_DIR)/include
LDLIBS = $(MYSQL_CONCPP_DIR)/lib64/libmysqlcppconn8-static.a -lssl -lcrypto -lpthread
CXXFLAGS = -std=c++11
main : main.cpp

Main.cpp is as simple as this:

#include <mysqlx/xdevapi.h>
int main() { return 0; }

I get a few errors. The first one is:
/usr/include/mysql-cppconn-8/lib64/libmysqlcppconn8-static.a(libcdk_foundation_socket_detail.cc.o): In function `cdk::foundation::connection::detail::srv_list(std::string const&)':
socket_detail.cc:(.text+0x11c2): undefined reference to `__res_nsearch'
socket_detail.cc:(.text+0x11f7): undefined reference to `ns_initparse'
socket_detail.cc:(.text+0x133d): undefined reference to `ns_parserr'
socket_detail.cc:(.text+0x13b0): undefined reference to `__dn_expand'

What am I doing wrong here?

Options: ReplyQuote


Subject
Views
Written By
Posted
Static linking to Connector/C++ on linux giving errors
2345
April 08, 2020 09:19AM


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.