4 messages in com.mysql.lists.plusplusRe: build problems
FromSent OnAttachments
Andres Salomon05 Feb 2008 10:00 
Warren Young05 Feb 2008 13:24 
Andres Salomon07 Feb 2008 08:50 
Warren Young07 Feb 2008 14:09 
Subject:Re: build problems
From:Andres Salomon (dili@queued.net)
Date:02/07/2008 08:50:43 AM
List:com.mysql.lists.plusplus

On Tue, 5 Feb 2008 13:01:08 -0500 Andres Salomon <dili@queued.net> wrote:

Hi,

While attempting to build 3.0.0-rc3, I've run into two separate build problems. The first is the version of install-sh that's shipped in the

[...]

Some additional problems as well when attempting to compile with a gcc 4.3 snapshot:

g++ -c -o mysqlpp_connection.o -I. -fPIC -DPIC -I/usr/include/mysql -g -Wall -O2
./lib/connection.cpp In file included from ./lib/connection.cpp:30: ./lib/dbdriver.h:228: error: ‘UINT_MAX’ was not declared in this scope ./lib/dbdriver.h: In member function ‘MYSQL_FIELD*
mysqlpp::DBDriver::fetch_field(MYSQL_RES*, size_t) const’: ./lib/dbdriver.h:230: error: ‘UINT_MAX’ was not declared in this scope In file included from ./lib/row.h:33, from ./lib/result.h:40, from ./lib/query.h:36, from ./lib/connection.cpp:31: ./lib/mystring.h: In constructor ‘mysqlpp::String::String(const char*,
mysqlpp::mysql_type_info, bool)’: ./lib/mystring.h:227: error: ‘strlen’ was not declared in this scope ./lib/mystring.h: In member function ‘void mysqlpp::String::assign(const char*,
mysqlpp::mysql_type_info, bool)’: ./lib/mystring.h:272: error: ‘strlen’ was not declared in this scope ./lib/mystring.h: In member function ‘mysqlpp::String&
mysqlpp::String::operator=(const char*)’: ./lib/mystring.h:456: error: ‘strlen’ was not declared in this scope make[1]: *** [mysqlpp_connection.o] Error 1 make[1]: Leaving directory `/mysql++-3.0.0' make: *** [debian/stamp-makefile-build] Error 2

The reason for the build errors is explained here:

http://www.cyrius.com/journal/2007/05/10#gcc-4.3-include

The patch below allows it to compile with gcc-4.3.

From 95f334eaee2f0449b0f751ab99559ed766a7d866 Mon Sep 17 00:00:00 2001 From: Andres Salomon <dili@debian.org> Date: Thu, 7 Feb 2008 16:44:03 +0000 Subject: [PATCH] include missing headers required to build with gcc 4.3

Signed-off-by: Andres Salomon <dili@debian.org>

--- examples/cmdline.cpp | 1 + lib/datetime.cpp | 1 + lib/dbdriver.h | 2 ++ lib/mystring.h | 1 + lib/sql_buffer.cpp | 2 ++ lib/tcp_connection.cpp | 1 + 6 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/examples/cmdline.cpp b/examples/cmdline.cpp index 509a8d8..1f56bb7 100644 --- a/examples/cmdline.cpp +++ b/examples/cmdline.cpp @@ -30,6 +30,7 @@

#include <stdio.h> #include <string.h> +#include <stdlib.h>

//// globals and constants ///////////////////////////////////////////// diff --git a/lib/datetime.cpp b/lib/datetime.cpp index 7073c81..a63574a 100644 --- a/lib/datetime.cpp +++ b/lib/datetime.cpp @@ -34,6 +34,7 @@ #include <iomanip>

#include <time.h> +#include <stdlib.h>

using namespace std;

diff --git a/lib/dbdriver.h b/lib/dbdriver.h index 140ede6..d973f18 100644 --- a/lib/dbdriver.h +++ b/lib/dbdriver.h @@ -34,6 +34,8 @@

#include <typeinfo>

+#include <limits.h> + namespace mysqlpp {

/// \brief Provides a thin abstraction layer over the underlying database diff --git a/lib/mystring.h b/lib/mystring.h index cbc701e..dc82133 100644 --- a/lib/mystring.h +++ b/lib/mystring.h @@ -41,6 +41,7 @@ #include <limits>

#include <stdlib.h> +#include <string.h>

namespace mysqlpp {

diff --git a/lib/sql_buffer.cpp b/lib/sql_buffer.cpp index d8caaa4..4cf8f36 100644 --- a/lib/sql_buffer.cpp +++ b/lib/sql_buffer.cpp @@ -25,6 +25,8 @@

#include "sql_buffer.h"

+#include <string.h> + namespace mysqlpp {

diff --git a/lib/tcp_connection.cpp b/lib/tcp_connection.cpp index 11e9288..fb17f6f 100644 --- a/lib/tcp_connection.cpp +++ b/lib/tcp_connection.cpp @@ -34,6 +34,7 @@ #endif

#include <ctype.h> +#include <stdlib.h>

using namespace std;