List:MySQL++« Previous MessageNext Message »
From:Vincent Date:October 15 2008 1:22am
Subject:Build error under Cygwin
View as plain text  

I came across 2 errors when compiling MySQL++ on a fresh Cygwin install.
The good news is that I solved them :)

I'm using :
 - MySQL 5.0.67
 - MySQL++ 3.0.6
 - GCC 3.4.4

Here is the first error :

/home/Bab/mysql++-3.0.6/bk-deps g++ -c -o mysqlpp_tcp_connection.o -I.
-g -O2 ./lib/tcp_connection.cpp
./lib/tcp_connection.cpp: In static member function `static bool
ss(std::string&, unsigned int&, std::string&)':
./lib/tcp_connection.cpp:133: error: `ntohs' undeclared (first use this
./lib/tcp_connection.cpp:133: error: (Each undeclared identifier is reported
only once for each func
tion it appears in.)
make: *** [mysqlpp_tcp_connection.o] Error 1

To fix this I've just added this line in tcp_connection.cpp :
#include <arpa/inet.h>

The second one is a linker error :

g++ -shared -o cygmysqlpp-3.dll mysqlpp_beemutex.o mysqlpp_connection.o
mysqlpp_cpool.o mysqlpp_date
time.o mysqlpp_dbdriver.o mysqlpp_field_names.o mysqlpp_field_types.o
mysqlpp_manip.o mysqlpp_myset.
o mysqlpp_mysql++.o mysqlpp_mystring.o mysqlpp_null.o mysqlpp_options.o
mysqlpp_qparms.o mysqlpp_que
ry.o mysqlpp_result.o mysqlpp_row.o mysqlpp_sql_buffer.o mysqlpp_stadapter.o
o mysqlpp_transaction.o mysqlpp_type_info.o mysqlpp_uds_connection.o
mysqlpp_vallist.o mysqlpp_wnp_c
onnection.o -L/usr/local/lib/mysql -Wl,--enable-auto-import
-lz  -lintl  -lmysqlclient
undefined reference
 to `_compress'
undefined referenc
e to `_compress'
undefined referenc
e to `_uncompress'
Creating library file: libmysqlpp.dll.a
collect2: ld returned 1 exit status
make: *** [cygmysqlpp-3.dll] Error 1

compress and uncompress are supposed to be in zlib and the -lz switch is
here so this sounds weird.
After some search on the internet I decided to put the -lz at the end of the
command line, after -lmysqlclient and ... it worked !
Maybe a compiler bug ? So I tried with GCC 4.3.2 witch is in alpha under
cygwin but got the same result...

Any ideas ?

Anyway I hope those 2 little fix can be usefull.

Build error under CygwinVincent15 Oct
  • Re: Build error under CygwinWarren Young15 Oct