dbTalk Databases Forums  

Problems building lib on SunOS

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss Problems building lib on SunOS in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave Brooks
 
Posts: n/a

Default Problems building lib on SunOS - 11-09-2005 , 01:00 PM







Hi All,

I originally sent this to plusplus-owner, sorry about that; having one of
those (geriatric) days...


I'm experiencing difficulties building the mysql++ libs on a SunOS 5.8
platform with gcc version 3.2.3. I took the time to search through the list
archives, but didn't have a lot of luck.

Has anyone out there successfully built the lib on the above mentioned
configuration?

I'm trying to build mysql 2.0.6. I am able to configure successfully with
the line:

CPPFLAGS="-I/usr/include/sys -I/usr/include" LDFLAGS=-L/usr/lib ./configure
--prefix=/usr/local --with-mysql=/opt/mysql
--with-mysql-lib=/opt/mysql-3.23.52/lib
--includedir=/usr/local/include/mysql++

*I had to add the explicit line for the mysql lib to get it to work.
/opt/mysql is a symbolic link to /opt/mysql-3.23.52

When I try to make (under sudo, just in case that makes a difference to
anyone), I get the following:

--- cut & paste
----------------------------------------------------------------------------
----------
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I/usr/include/sys
g++ -I/usr/include -I/opt/mysql/include -g -O2 -c coldata.cpp -MT
g++ coldata.lo -MD -MP -MF .deps/coldata.TPlo -fPIC -DPIC -o coldata.lo
In file included from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/cwchar:51,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/bits/fpos.h:45,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/bits/char_traits.h:46,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/string:47,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/stdexcept:45,
from const_string.h:34,
from coldata.h:37,
from coldata.cpp:27:
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:68: `tm' not declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:70: `clock' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:71: `difftime' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:72: `mktime' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:73: `time' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:74: `asctime' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:75: `ctime' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:76: `gmtime' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:77: `localtime' not
declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:78: `strftime' not
declared
make[2]: *** [coldata.lo] Error 1
make[2]: Leaving directory `/usr1/dtb26/dave_work/mysql++-2.0.6/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr1/dtb26/dave_work/mysql++-2.0.6'
make: *** [all] Error 2
--- end cut & paste
----------------------------------------------------------------------------
-----

Of course, ctime undef's all the above mentioned structures in favor of
std::<functions>. I poured through coldata.h/.cpp and don't see anything
trying to use these calls (I thought maybe something was lacking std
namespace resolution or something).

Has anyone else run into this situation and if so, were you able to resolve
it?

Thanks in advance for any light anyone might be able to shed on this.

Thanks,
Dave
----------------------------------------
David Brooks
Instructional & Web Services
Academic Technology & Media Services
Cornell Information Technologies
Cornell University
(607)254-1551
dtb26 (AT) cornell (DOT) edu
http://www.cit.cornell.edu/atc/



--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Chris Frey
 
Posts: n/a

Default Re: Problems building lib on SunOS - 11-09-2005 , 01:15 PM






On Wed, Nov 09, 2005 at 02:00:59PM -0500, Dave Brooks wrote:
Quote:
--- cut & paste
----------------------------------------------------------------------------
----------
g++ -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I/usr/include/sys
g++ -I/usr/include -I/opt/mysql/include -g -O2 -c coldata.cpp -MT
g++ coldata.lo -MD -MP -MF .deps/coldata.TPlo -fPIC -DPIC -o coldata.lo
In file included from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/cwchar:51,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/bits/fpos.h:45,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/bits/char_traits.h:46,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/string:47,
from
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/stdexcept:45,
from const_string.h:34,
from coldata.h:37,
from coldata.cpp:27:
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:68: `tm' not declared
/opt/common/lib/gcc-lib/../../include/c++/3.2.3/ctime:70: `clock' not
declared
This appears to be a bug in the gcc C++ headers. mysql++ doesn't use
C time functions, and as the include list shows, they are being included
indirectly through stdexcept.

You might try upgrading the compiler, or you can hack the source to
include <time.h> manually, before anything else.

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Dave Brooks
 
Posts: n/a

Default RE: Problems building lib on SunOS - 11-10-2005 , 11:29 AM




Hi there...

Quote:
This appears to be a bug in the gcc C++ headers. mysql++
doesn't use C time functions, and as the include list shows,
they are being included indirectly through stdexcept.

You might try upgrading the compiler, or you can hack the
source to include <time.h> manually, before anything else.

It appears that you may have been right Chris. I tried building on another
SunOS box and got the same results, so I built gcc version 4.0.1 and that
error went away. I immeadiately ran into two more issues however:

connection.cpp: In member function 'void
mysqlpp::Connection::enable_ssl(const char*, const char*, const char*, const
char*, const char*)':
connection.cpp:589: error: 'mysql_ssl_set' was not declared in this scope
make[2]: *** [connection.lo] Error 1
make[2]: Leaving directory `/usr1/dtb26/dave_work/mysql++-2.0.6/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr1/dtb26/dave_work/mysql++-2.0.6'
make: *** [all] Error 2

The only mysql_ssl_set(...) in mysql.h is defined as:

#ifdef HAVE_OPENSSL
int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath);

#endif /* HAVE_OPENSSL */


Yours has an extra char*, is there another definition somewhere I am
missing?

void
Connection::enable_ssl(const char* key, const char* cert,
const char* ca, const char* capath, const char* cipher)
{
mysql_ssl_set(&mysql_, key, cert, ca, capath, cipher);
}

I don't plan to use ssl, and the code will compile if I comment out this
call. Would that effect anything else that I am not aware of? Taking out
the extra arg didn't help, the error remained the same.

Thanks,
Dave
----------------------------------------
David Brooks
Instructional & Web Services
Academic Technology & Media Services
Cornell Information Technologies
Cornell University
(607)254-1551
dtb26 (AT) cornell (DOT) edu
http://www.cit.cornell.edu/atc/



--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #4  
Old   
Chris Frey
 
Posts: n/a

Default Re: Problems building lib on SunOS - 11-10-2005 , 12:13 PM



On Thu, Nov 10, 2005 at 12:30:23PM -0500, Dave Brooks wrote:
Quote:
The only mysql_ssl_set(...) in mysql.h is defined as:

#ifdef HAVE_OPENSSL
int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath);

#endif /* HAVE_OPENSSL */

Yours has an extra char*, is there another definition somewhere I am
missing?
Looks like you found a bug. :-)


Quote:
I don't plan to use ssl, and the code will compile if I comment out this
call. Would that effect anything else that I am not aware of? Taking out
the extra arg didn't help, the error remained the same.
Try changing your config.h manually to disable HAVE_OPENSSL. There might
be a --disable-openssl in configure, but I don't have a machine in front
of me to check. That would be the best way.

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #5  
Old   
Ovidiu Bivolaru
 
Posts: n/a

Default Re: Problems building lib on SunOS - 11-10-2005 , 12:38 PM



--------------090200000602020109040006
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I've encountered a similar issue when trying to build mysql++-2.0.6 with
MySQL 3.23.58. If you are using MySQL 3.23.x and you don't need SSL you
could try my patch. MySQL versions newer than 4.0.x have mysql_ssl_set()
with different number of arguments than 3.23.x.

Regards,
Ovidiu

Chris Frey wrote:

Quote:
On Thu, Nov 10, 2005 at 12:30:23PM -0500, Dave Brooks wrote:


The only mysql_ssl_set(...) in mysql.h is defined as:

#ifdef HAVE_OPENSSL
int STDCALL mysql_ssl_set(MYSQL *mysql, const char *key,
const char *cert, const char *ca,
const char *capath);

#endif /* HAVE_OPENSSL */

Yours has an extra char*, is there another definition somewhere I am
missing?



Looks like you found a bug. :-)




I don't plan to use ssl, and the code will compile if I comment out this
call. Would that effect anything else that I am not aware of? Taking out
the extra arg didn't help, the error remained the same.



Try changing your config.h manually to disable HAVE_OPENSSL. There might
be a --disable-openssl in configure, but I don't have a machine in front
of me to check. That would be the best way.

- Chris





--------------090200000602020109040006
Content-Type: text/x-diff;
name="mysql++_3_23_58.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="mysql++_3_23_58.patch"

diff -Naur mysql++-2.0.6/lib/connection.cpp mysql++-2.0.6.patch/lib/connection.cpp
--- mysql++-2.0.6/lib/connection.cpp 2005-09-26 17:21:49.000000000 +0300
+++ mysql++-2.0.6.patch/lib/connection.cpp 2005-10-08 02:31:25.000000000 +0300
@@ -581,14 +581,14 @@
return false;
}

-
+#if MYSQL_VERSION_ID >= 40101
void
Connection::enable_ssl(const char* key, const char* cert,
const char* ca, const char* capath, const char* cipher)
{
mysql_ssl_set(&mysql_, key, cert, ca, capath, cipher);
}
-
+#endif

ostream&
Connection::api_version(ostream& os)
diff -Naur mysql++-2.0.6/lib/connection.h mysql++-2.0.6.patch/lib/connection.h
--- mysql++-2.0.6/lib/connection.h 2005-09-26 17:21:49.000000000 +0300
+++ mysql++-2.0.6.patch/lib/connection.h 2005-10-08 02:30:59.000000000 +0300
@@ -399,7 +399,7 @@

/// \brief Sets a connection option, with Boolean argument
MYSQLPP_EXPORT bool set_option(Option option, bool arg);
-
+#if MYSQL_VERSION_ID >= 40101
/// \brief Enable SSL-encrypted connection.
///
/// \param key the pathname to the key file
@@ -415,7 +415,7 @@
MYSQLPP_EXPORT void enable_ssl(const char* key = 0,
const char* cert = 0, const char* ca = 0,
const char* capath = 0, const char* cipher = 0);
-
+#endif
/// \brief Return the number of rows affected by the last query
///
/// Simply wraps \c mysql_affected_rows() in the C API.


--------------090200000602020109040006
Content-Type: text/plain; charset=us-ascii


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw
--------------090200000602020109040006--


Reply With Quote
  #6  
Old   
Warren Young
 
Posts: n/a

Default Re: Problems building lib on SunOS - 11-10-2005 , 03:02 PM



Ovidiu Bivolaru wrote:
Quote:
If you are using MySQL 3.23.x and you don't need SSL you
could try my patch. MySQL versions newer than 4.0.x have mysql_ssl_set()
with different number of arguments than 3.23.x.
If you change your patch to detect the proper number of arguments
instead of just removing Connection::enable_ssl() from the library, I'll
accept it for the next version.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #7  
Old   
Ovidiu Bivolaru
 
Posts: n/a

Default Re: Problems building lib on SunOS - 11-11-2005 , 07:36 AM



Hi Warren,

I've been too lazy when I've said it is just about the number of
parameters of mysql_ssl_set() ("cipher" is not available with MySQL
3.23.X API). I've never used MySQL with SSL connections so far, but I
know that MySQL 3.23.x doesn't fully support SSL internally. Full SSL
support was introduced in 4.0.x (please correct me if I'm wrong).
MySQL 3.23.5x can be installed with or without SSL support on various
operating systems and I this would require more autotools hacking for
mysql++ to identify MySQL version and provide SSL support or not for
mysql++ (add -DHAVE_OPENSSL for MySQL 3.x). Since I'm not good at
autotools stuff, I've choosed to make the patch the way it is and it
served for my propose. So, I'm reading a good automake/autoconf book
meanwhile My initial plan was to provide a patch as you are asking,
but it didn't worked for me. I will let you know if I can do something
about this. Thanks!

Regards,
Ovidiu

Warren Young wrote:

Quote:
Ovidiu Bivolaru wrote:

If you are using MySQL 3.23.x and you don't need SSL you
could try my patch. MySQL versions newer than 4.0.x have
mysql_ssl_set() with different number of arguments than 3.23.x.


If you change your patch to detect the proper number of arguments
instead of just removing Connection::enable_ssl() from the library,
I'll accept it for the next version.


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #8  
Old   
Warren Young
 
Posts: n/a

Default Re: Problems building lib on SunOS - 11-11-2005 , 01:18 PM



Ovidiu Bivolaru wrote:
Quote:
So, I'm reading a good automake/autoconf book
meanwhile My initial plan was to provide a patch as you are asking,
but it didn't worked for me. I will let you know if I can do something
about this. Thanks!
Go ahead and take that path if you are doing it mainly because the
exercise is interesting and educational. But since 3.23 is so old, I
would accept a patch that just has an extra ifdef for the "3.32 with
SSL" case, and ignores the "without SSL" case. There just isn't much
cause for heroics just to support such old software.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.