我有一个问题,我想用 mysql 连接器的静态链接来编译我的应用程序。
我的命令行:
g++ -o newserver stdafx.cpp ... -lboost_system -lboost_thread -lpthread -lmysqlcppconn -static /usr/lib/libmysqlcppconn-static.a -std=c++0x
但我有错误:
/usr/bin/ld: cannot find -lmysqlcppconn
/tmp/ccxpOfdZ.o: In function `IsEqualsDns(unsigned long, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
Server.cpp:(.text+0x356e): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: ld returned 1 exit status
我怎样才能解决这个问题?谢谢!