List:MySQL++« Previous MessageNext Message »
From:axel.howind Date:July 9 2007 12:13pm
Subject:Re: Re: MySQL include paths
View as plain text  
Remi Collet wrote:
> I think MySQL++ do this because it's the "normal" way to do.

You mean "normal" in the MySQL sense. I wouldn't mind it, if the  
header's names were somehow distinguishable from others, i.e. by using  
a common prefix. In the version installed on my redhat box (4.1.20),  
there are 41 headers under /usr/include/mysql, many of those with  
names like xmalloc.h, tilde.h, readline.h etc.

Take readline.h as an example. There is a copy of it within the  
mysql-directory and one in readline's own. Now what to do when using  
readline and mysql_client libraries? Hope both are the same version or  
at least binary ccompatible?

I prefer the "normal" way in the OpenGL sense: adding a directory
prefix in your include directives.

> You can't predict what is the MySQL header Path, so the best solution
> is to use, in your makefile $(shell mysql-config --cflags).
> This solution allow multiple instance of the MySQL Client. For example,
> under Fedora/Redhat :
> mysql-devel (MySQL 5.0.37)=> /usr/include/mysql
> mysqlclient10-devel (MySQL 3.23.58) => /usr/include/mysql3/mysql
> mysqlclient14-devel (MySQL 4.1.14/usr/include/mysql4/mysql

The mysql_config only works for the first of these, for the remaining  
two, you also have to explicitly define the include path. And IMHO  
there's no real advantage in using -I/usr/include/mysql3/mysql over  


PS: On my new ubuntu system with mysql version 5.x (don't have it here  
right now to check the exact version), most of the non-prefixed  
headers are gone. The remaining all have the prefix "my_". So, the  
situation seems to get better...

Re: Re: MySQL include pathsaxel.howind9 Jul