Equivalent to libmysqldev FreeBSD

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?

Asked By: free

Answer #1:

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, while the libraries will go to /usr/local/lib/mysql/.

So - just install a client from ports or packages, and you are set.

Answered By: Grrrr

Answer #2:

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.

Answered By: FoneyOp
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

# More Articles