Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
MySQL include paths

MySQL include paths

2007-07-08       - By Axel Howind

 Back
Reply:     1     2     3     4     5     6  

Hello,

compiling a small program that uses the MySQL++-library, I was wondering
why I have to include mysql's include directory to my include path.
Well, I know, otherwise the compiler won't be able to find the mysql
headers. But once it took me hours to hunt down an error that turned out
to be caused by two different libraries that had nothing to do with each
other, but both installed a header file with the same name
("exception.h", if I remember well).

That's why now I pretty much dislike adding everything to my include
path. Instead I for example write  #include <mysql/mysql_version.h> and
keep the include path short.

But I can't do this with MySQL++, since MySQL++ relies on having the
MySQL headers in the include path.

Would a patch to the MySQL++ headers be accepted to include mysql
headers in the <mysql/...> way?

Some programs makefiles (or MSdev-settings) would possibly have to be
changed if mysql headers are installed in nonstandard locations.

So, what do you think?


Axel



PS: Here's a patch against todays svn, if you want to give it a try...


Index: lib/coldata.h
===================================================================
--- lib/coldata.h    (revision 1635)
+++ lib/coldata.h    (working copy)
@@ -41,7 +41,7 @@
#include "string_util.h"
#include "type_info.h"

-#include <mysql.h>
+#include <mysql/mysql.h>

#include <typeinfo>
#include <string>
Index: lib/common.h
===================================================================
--- lib/common.h    (revision 1635)
+++ lib/common.h    (working copy)
@@ -34,7 +34,7 @@
#if !defined(DOXYGEN_IGNORE)
// Doxygen will not generate documentation for the following stuff.

-#include <mysql_version.h>
+#include <mysql/mysql_version.h>

// Work out major platform-specific stuff here.
#if defined(__WIN32__) || defined(_WIN32)
@@ -140,7 +140,7 @@
// MySQL header.  Basically, the above largely replaces MySQL's my_global.h
// while actually working with C++.  This is why we disobey the MySQL
// developer docs, which recommend using my_global.h.
-#include <mysql.h>
+#include <mysql/mysql.h>


namespace mysqlpp {
Index: lib/connection.h
===================================================================
--- lib/connection.h    (revision 1635)
+++ lib/connection.h    (working copy)
@@ -40,7 +40,7 @@
#include "lockable.h"
#include "noexceptions.h"

-#include <mysql.h>
+#include <mysql/mysql.h>

#include <deque>
#include <string>
Index: lib/manip.h
===================================================================
--- lib/manip.h    (revision 1651)
+++ lib/manip.h    (working copy)
@@ -48,7 +48,7 @@
#include "myset.h"
#include "sql_string.h"

-#include <mysql.h>
+#include <mysql/mysql.h>

#include <iostream>

Index: lib/query.h
===================================================================
--- lib/query.h    (revision 1635)
+++ lib/query.h    (working copy)
@@ -38,7 +38,7 @@
#include "row.h"
#include "sql_string.h"

-#include <mysql.h>
+#include <mysql/mysql.h>

#include <deque>
#include <iomanip>
Index: lib/result.h
===================================================================
--- lib/result.h    (revision 1635)
+++ lib/result.h    (working copy)
@@ -38,7 +38,7 @@
#include "resiter.h"
#include "row.h"

-#include <mysql.h>
+#include <mysql/mysql.h>

#include <map>
#include <set>
Index: lib/type_info.h
===================================================================
--- lib/type_info.h    (revision 1635)
+++ lib/type_info.h    (working copy)
@@ -33,7 +33,7 @@

#include "common.h"

-#include <mysql.h>
+#include <mysql/mysql.h>

#include <map>
#include <typeinfo>


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus?unsub=mysql@(protected)