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?
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?