Quantcast
Channel: MySQL Forums - Connector/C++
Viewing all articles
Browse latest Browse all 527

Static linking to Connector/C++ on linux giving errors (3 replies)

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

Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>