由于glibc和libmysqlclient,我无法构建应用程序

时间:2015-05-28 09:44:06

标签: linux cmake

我的计算机上有一个应用程序,当我尝试构建它时,它会说

/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libmysqlclient.a(client_plugin.c.o): In function `mysql_load_plugin_v':
(.text+0x466): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libmysqlclient.a(mf_pack.c.o): In function `unpack_dirname':
(.text+0x7ab): warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libmysqlclient.a(libmysql.c.o): In function `read_user_name':
(.text+0x2488): warning: Using 'getpwuid' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libmysqlclient.a(mf_pack.c.o): In function `unpack_dirname':
(.text+0x7b7): warning: Using 'endpwent' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libmysqlclient.a(client.c.o): In function `mysql_real_connect':
(.text+0x3e71): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libmysqlclient.a(libmysql.c.o): In function `mysql_server_init':
(.text+0x224e): warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/libstdc++.a(eh_globals.o): undefined reference to symbol '__tls_get_addr@@GLIBC_2.3'
//lib/x86_64-linux-gnu/ld-linux-x86-64.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [app] Error 1
make[2]: *** [CMakeFiles/app.dir/all] Error 2
make[1]: *** [CMakeFiles/app.dir/rule] Error 2
make: *** [app] Error 2
*** Failure: Exit code 2 ***

我无法弄清楚发生了什么,因为安装了glibc:

$ ldd --version
ldd (Ubuntu EGLIBC 2.19-0ubuntu6.6) 2.19
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

还安装了libmysqlclient:

$ sudo apt-get install libmysqlclient-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libmysqlclient-dev is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-3.13.0-45 linux-headers-3.13.0-45-generic
  linux-image-3.13.0-45-generic linux-image-extra-3.13.0-45-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.

请帮忙吗?

0 个答案:

没有答案