- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在尝试从源代码构建 mysql-connector-c(根据指令 here )并静态链接到我的应用程序中的库。但是,我收到以下警告,我想知道是否有人对这是为什么有任何想法:
/path/to/lib/libmysqlclient.a(mf_pack.c.o): In function `unpack_dirname':
mf_pack.c:(.text+0x90b): warning: Using 'getpwnam' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
/path/to/lib/libmysqlclient.a(libmysql.c.o): In function `read_user_name':
libmysql.c:(.text+0x2b06): warning: Using 'getpwuid' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
/path/to/lib/libmysqlclient.a(mf_pack.c.o): In function `unpack_dirname':
mf_pack.c:(.text+0x916): warning: Using 'endpwent' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
/path/to/lib/libmysqlclient.a(client.c.o): In function `mysql_real_connect':
client.c:(.text+0x305c): warning: Using 'getaddrinfo' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
/path/to/lib/libmysqlclient.a(libmysql.c.o): In function `mysql_server_init':
libmysql.c:(.text+0x2f9b): warning: Using 'getservbyname' in statically linked
applications requires at runtime the shared libraries from the glibc version
used for linking
以下是一些相关的参数/标志:
为了构建库,CMake 正在传递以下内容:
-G "Unix Makefiles"-DCMAKE_INSTALL_PREFIX=/path/to/my/install/root -DCMAKE_C_FLAGS="-m64"-DCMAKE_CXX_FLAGS="-m64"
用于构建应用程序:
CFLAGS := $(CFLAGS) -Werror -Wall -ggdb -gdwarf-2
LDFLAGS := $(LDFLAGS) -static -ggdb -gdwarf-2
最佳答案
出现这些警告是因为有问题的 GLibC 函数使用了 GLibC Name Service Switch (NSS)内部机制:
The basic idea is to put the implementation of the different services offered to access the databases in separate modules. This has some advantages:
- Contributors can add new services without adding them to the GNU C Library.
- The modules can be updated separately.
- The C library image is smaller.
To fulfill the first goal above the ABI of the modules will be described below. For getting the implementation of a new service right it is important to understand how the functions in the modules get called. They are in no way designed to be used by the programmer directly. Instead the programmer should only use the documented and standardized functions to access the databases.
由于 NSS 机制依赖于动态链接来工作,因此无论您是静态链接还是动态链接,您都需要在运行时使用适当的 NSS 模块(其中大部分随 glibc 一起提供)才能使用这些功能C库本身。那里的警告是为了提醒您在运行时您确实需要这些模块;尝试在没有 NSS 模块的盒子上运行链接的二进制文件将在运行时失败,并出现来自 ld.so 的错误,提示它找不到“libnss_files.so.2”或类似的东西。
关于mysql - 针对 mysql-connector-c/libmysqlclient/mysql C API 构建应用程序时的链接器警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5426420/
我刚刚用 Ubuntu 10.04.1 amd64 服务器构建了一个新的开发盒,安装了所有的库和东西,但现在我的程序在 libmysqlclient16 中随机出现段错误。 只是为了消除我试图降级到
我有多个线程需要连接到 MySQL 服务器的单个实例。如果每个线程都创建并处理自己的连接,那么一切都会按预期进行。我想像这样实现一个简单的连接池: void query_user(MYSQL* con
在 Amazon EC2 上(uname -r 给出“3.4.37-40.44.amzn1.x86_64”,我听说它基于 Cent OS)我尝试安装: yum install mysql yum in
我正在 Linux 平台上构建 C 应用程序。我需要使用 libmysqlclient 连接到数据库。 我下载了linux源码包mysql-connector-c-6.0.2.tar.gz。我按照说明
我在使用 zappa 部署的 AWS lambda 上运行了 Flask API。 虽然实例化它无法找到 libmysqlclient.so.18 文件,我认为这会消耗大量时间。 附加图像中的错误消息
我正在尝试使用 flatpak 构建一个 Vala 程序。我需要连接到 mysql 服务器,这就是为什么我需要将 libmysqlclient 与我的 flatpak 捆绑在一起。 这就是我将 mys
ruby 2.6.3乌类图16.04无法找到包 libmysqlclient-dev 说明:获取mysql2 0.5.2安装带有 native 扩展的 mysql2 0.5.2Gem::Ext::Bu
我设置了 Crontab: [root@root mysql]# crontab -l 5 * * * * php /home/admin/public_html/scheduleSendMa
我想启动一个进程,但它显示“./log/BillServer_err:./Bill/BillServer: 加载共享库时出错:libmysqlclient.so.18: 无法打开共享对象文件:没有这样
我记得,几年前当我开始使用 mySQL 时,为了找到库(尤其是 mySQL 库!)而“就这样”设置东西是一场噩梦。就我而言,我相信 ldconfig 是解决问题的工具。快进到 2012 年 - 刚刚安
我开始安装,现在我收到文件依赖性错误 参见: root@ca [~/sitebuilder]# rpm -Uhv updates/*.rpm error: Failed dependencies: l
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎与 help center 中定义的范围内的编程无关。 . 关闭 7 年前。 Improve
我一直在遵循 StackOverflow 帖子的建议,并且有人要求我使用 MySQLdb 来验证我的计算机上是否有 libmysqlclient.16.dylib。在 OS X 10.8 中哪里可以找
我正在尝试创建一个项目,但出现了错误。 [root@54 Source]# make -j8 -C ./Connector usa make: se ingresa al directorio `/l
我想研究mysql-connector-java依赖于.so文件 你知道mysql-connector是纯java的吗? 最佳答案 MySQL Connector/J 是纯 Java 驱动程序。它不需
我在一个共享托管服务器上运行一个 python 脚本,直到今天早上,该服务器的 MySQL 版本为 4。现在它有版本 5。我的 python 脚本无法再连接到 MySQL,因为它找不到 libmysq
问题:内存泄漏的原因是什么? 情况:我使用 C++ 和使用 MySQL C API 的 MySQL 构建了一个简单的命令行程序 问题是,程序从对象 malloc xx bytes" 中发生了许多“小”
我正在尝试捆绑安装,但中途出现错误: Make sure that `gem install mysql -v '2.9.1'` succeeds before bundling. and while
我尝试了日以继夜地谷歌搜索和阅读 MySQL 文档,但我似乎无法找出可能导致内存泄漏的原因。 它似乎是随机发生的,这是唯一泄漏的函数。 代码: unsigned long numRowQuery(st
我应该使用哪个来链接 mysqlclient 库?它们之间有什么区别?我似乎找不到答案。谢谢。 最佳答案 较新版本的 MySQL 客户端分发不包括“_r”版本。有些可能有从 libmyqslclien
我是一名优秀的程序员,十分优秀!