相当于 FreeBSD 的 libmysqldev
我使用 mysql 开发库(在头文件中包含 mysql.h)在 fedora 中编译了一个程序。我需要在 FreeBSD 上编译。我不想从源代码下载并编译,而是想从端口或等效的东西下载,以便在需要时方便删除它。 有谁知道 FreeBSD 中的 libmysql-dev 的等效项吗?我在ports里没找到?
I have compiled a program in fedora using the mysql dev library (include mysql.h in header file). I need to compile in on FreeBSD. I do not want to download from source and compile but rather would like to download from ports or something equivalent to facilitate removing it if need be.
Does anyone know the equivalent of the libmysql-dev in FreeBSD. I have not found it in ports?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您不需要为此使用特殊的包。标准 mysql 客户端包/端口已经包含您需要的库和头文件。头文件将最终由
默认,在
/usr/local/include/mysql/
目录中,而这些库将转到
/usr/local/lib/mysql/
。因此,只需从端口或软件包安装客户端即可。
You do not need a special package for this. The standard mysql client package/port already includes the libraries and the header files you will need. The header files will end up, by
default, in
/usr/local/include/mysql/
directory, whilethe libraries will go to
/usr/local/lib/mysql/
.So - just install a client from ports or packages, and you are set.
mysql.h 包含在 mysql-client-xx 端口中。
假设您有配置脚本或 makefile,您应该将 LDFLAGS 和 CPPFLAGS 环境变量设置为:
导出 LDFLAGS='-l /usr/local/lib'
导出 CPPFLAGS='-I /usr/local/include'
(或 setenv,如果使用 csh)
然后 ./configure 并正常进行。
如果您从命令行“gcc -o myprog mysource.c”进行编译,只需将 -I 和 -l 选项添加到您的命令中,它应该可以正常编译。
尝试: find /usr/local -iname 'mysql' 查看您实际上已安装在系统上的文件(标头、共享对象和二进制文件)。
mysql.h is included in the mysql-client-xx port.
assuming you have a configure script or makefile you should set the LDFLAGS and CPPFLAGS environment variables to:
export LDFLAGS='-l /usr/local/lib'
export CPPFLAGS='-I /usr/local/include'
(or setenv, if using csh)
then ./configure and make as normal.
if you are compiling from the command line "gcc -o myprog mysource.c" just add the -I and -l options to your command and it should compile fine.
try: find /usr/local -iname 'mysql' to see files (headers, shared objects and binaries) you in fact have installed on your system.