Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Re: MySQL include paths

From: <axel.howind(at)htp-tel.de>
Date: Mon Jul 09 2007 - 08:13:32 EDT


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 -I/usr/include/mysql3.

Axel

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...

-- 
MySQL++ Mailing List
For list archives: 
http://lists.mysql.com/plusplus
To unsubscribe:    
http://lists.mysql.com/plusplus?unsub=lists@pantek.com
Received on Mon Jul 9 08:13:47 2007
Do you need help?X

This archive was generated by hypermail 2.1.8 : Tue Jul 10 2007 - 21:34:36 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library