undefined reference to eval_client, hosts_access, sock_host, request_init
You forgot to link libwrap if you get the following output compiling your application :
/usr/lib/libmysqld.a(lib_sql.o): In function "handle_connections_sockets": : undefined reference to "request_init" /usr/lib/libmysqld.a(lib_sql.o): In function "handle_connections_sockets": : undefined reference to "sock_host" /usr/lib/libmysqld.a(lib_sql.o): In function "handle_connections_sockets": : undefined reference to "hosts_access" /usr/lib/libmysqld.a(lib_sql.o): In function "handle_connections_sockets": : undefined reference to "eval_client" collect2: ld returned 1 exit status
You can link libwrap by adding /lib/libwrap.so.0 to your compilation (g++, gcc ) path.