[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems to include mysql.h in the Makefile

From: Benoit SIGOURE
Subject: Re: Problems to include mysql.h in the Makefile
Date: Tue, 17 Jul 2007 23:52:33 +0200

On Jul 17, 2007, at 8:22 PM, Damian Montaldo wrote:

Hi, i'm having some problems to include mysql.h when i compile C source code.

Hello Damian,

I'm using this macro
to find the path to mysql.h in a Debian Linux and work fine.

$ ./configure
checking for mysql_config... /usr/bin/mysql_config
checking for MySQL libraries... yes

When i run configure it generates this line in the Makefile file:

MYSQL_CFLAGS = -I/usr/include/mysql -DBIG_JOINS=1
MYSQL_CONFIG = /usr/bin/mysql_config
MYSQL_LDFLAGS = -L/usr/lib/mysql -lmysqlclient
But when i run make it doesn't include the MYSQL_CFLAGS so it's
imposible to resolve this #include <mysql.h>

This macro provides you with the flags required to use MySQL in your builds but it does not actually enforce them. And this is a sane behavior. So now, you simply need to use these flags whenever you need them, eg:

bin_PROGRAMS = mysqlcli
mysqlcli_SOURCES = ...
(don't forget to add the AM_*flags in the target-specific_*FLAGS)

Or simply...

bin_PROGRAMS = mysqlcli
mysqlcli_SOURCES = ...

... if you don't already use AM_CFLAGS and all the targets of this must use $(MYSQL_CFLAGS). If you already use AM_CFLAGS, then simply use `+=' instead of `='.


Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory

Attachment: PGP.sig
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]