dbTalk Databases Forums  

zlib and mysql++ build process

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


Discuss zlib and mysql++ build process in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dennis McFall
 
Posts: n/a

Default zlib and mysql++ build process - 03-28-2005 , 02:37 PM






------=_NextPart_000_000B_01C5339B.081FB3D0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I am attempting to build mysql++ on a Fedora Core 2 machine. The =
following rpms have been installed:

mysql++-1.7.32-1
mysql-devel-3.23.58-9
mysql-3.23.58-9
mysql-server-3.23.58-9
php-mysql-4.3.4-11
mysql++-devel-1.7.32-1
MySQL-shared-3.23.58-1

I have to stay with MYSQL version 3.23.58 due to the existing =
installbase.



The configure.h file that is generated states that I do not have support =
for zlib, however, I do, as the "rpm -qa" shows below.

rpm -qa | grep zlib*
zlib-1.2.1.1-2.1


The make process fails to complete because ld can't find -lz.

/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [libmysqlpp.la] Error 1
make[2]: Leaving directory `/home/insite/temp/mysql++-1.7.32/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/insite/temp/mysql++-1.7.32'
make: *** [all] Error 2

I attempted to show "configure" where the zlib.h file is by adding an =
"--includedir" option but this did not help.

../configure '--includedir=3D/usr/local/include/mysql++' =
'--includedir=3D/lib/modules/2.6.5-1.358/build/include/linux/' =
--enable-thread-check

Any suggestions?
------=_NextPart_000_000B_01C5339B.081FB3D0--



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

Default Re: zlib and mysql++ build process - 03-28-2005 , 03:27 PM






On Mon, Mar 28, 2005 at 01:35:39PM -0600, Dennis McFall wrote:
Quote:
mysql++-1.7.32-1
mysql-devel-3.23.58-9
mysql-3.23.58-9
mysql-server-3.23.58-9
php-mysql-4.3.4-11
mysql++-devel-1.7.32-1
MySQL-shared-3.23.58-1

I have to stay with MYSQL version 3.23.58 due to the existing installbase.
If you installed RedHat mysql packages, you need to build your own mysql++
RPM's, as I recall. The official RPM's are built with mysql.com RPM's
I believe. You can get the source RPM from the official mysql++ site too.


Quote:
rpm -qa | grep zlib*
zlib-1.2.1.1-2.1
If you're doing development, you generally need the -devel packages on
RedHat systems.

- 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   
Dennis McFall
 
Posts: n/a

Default Re: zlib and mysql++ build process - 03-28-2005 , 05:01 PM



------=_NextPart_000_0038_01C533AE.75A83090
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

After installing the Fedora Core 2 zlib dev package I was able to
successfully compile mysql++.

I still went ahead and added the two new path entries to the ld.so.conf =
file
and executed ldconfig.

Encouraged, I tried to compile my dbtest.cpp test program but still
encountered many errors. I have not
been able to determine what is going on even though I have tried for =
most of
the day. Unfortunately, in this case, my forte` is windows development
and not linux development. I may have screwed something up (versioning =
etc)
while I was trying to staisfy all the rpm dependencies. This machine =
was
not originally setup for development so I had to load gcc and everything =
it
depended on.

I am simply trying to use some of the sample code to connect to my local
database and execute a select query. The code is below:

#include <iostream>
#include <iomanip>
#include <mysql++.h>

using namespace mysqlpp;
using namespace std;

int main()
{
Connection con("test","localhost","test","test");
// The full format for the Connection constructor is
// Connection(cchar *db, cchar *host=3D"",
// cchar *user=3D"", cchar *passwd=3D"")
// You may need to specify some of them if the database is not on
// the local machine or you database username is not the same as your
// login name, etc..

Query query =3D con.query();
// This creates a query object that is bound to con.

query << "SELECT * FROM monitor";
// You can write to the query object like you would any other ostrem

Result res =3D query.store();
// Query::store() executes the query and returns the results

cout << "Query: " << query.preview() << endl;
// Query:review() simply returns a string with the current query
// string in it.

cout << "Records Found: " << res.size() << endl << endl;

Row row;
cout.setf(ios::left);
cout << setw(10) << "monitor_id"
<< setw(1) << "monitor_type"
<< setw(50) << "monitor_title"
<< setw(4) << "monitor_status"
<< setw(4) << "monitor_email"
<< setw(10) << "monitor_day_ttl"
<< setw(10) << "monitor_week_ttl"
<< setw(10) << "monitor_month_ttl" << endl;

Result::iterator i;
// The Result class has a read-only Random Access Iterator
for (i =3D res.begin(); i !=3D res.end(); i++) {
row =3D *i;
cout << setw(10) << row["monitor_id"]
<< setw(10) << row["monitor_type"]
<< setw(50) << row["monitor_title"]
<< setw(4) << row["monitor_status"]
<< setw(4) << row["monitor_email"]
<< setw(10) << row["monitor_day_ttl"]
<< setw(10) << row["monitor_week_ttl"]
<< setw(10) << row["monitor_month_ttl"] << endl;
}
return 0;
}

The errors I am getting are shown below:

[root@localhost temp]# g++ -o dbtest dbtest.cpp
/tmp/ccIwAWIf.o(.text+0x35): In function `main':
: undefined reference to =
`mysqlpp::Connection::Connection[in-charge](char
const*, char const*, char const*, char const*, bool)'
/tmp/ccIwAWIf.o(.text+0x4e): In function `main':
: undefined reference to `mysqlpp::Connection::query()'
/tmp/ccIwAWIf.o(.text+0x700): In function `main':
: undefined reference to `mysqlpp::Connection::~Connection =
[in-charge]()'
/tmp/ccIwAWIf.o(.text+0x79f): In function `main':
: undefined reference to `mysqlpp::Connection::~Connection =
[in-charge]()'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowC1Ev+0x2 c): In function
`mysqlpp::Row::Row[in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowC1Ev+0x3 8): In function
`mysqlpp::Row::Row[in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowD1Ev+0xc ): In function
`mysqlpp::Row::~Row [in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowD1Ev+0x1 8): In function
`mysqlpp::Row::~Row [in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp6ResultD1Ev+ 0x1a): In =
function
`mysqlpp::Result::~Result [in-charge]()':
: undefined reference to `mysqlpp::ResUse::~ResUse [not-in-charge]()'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp5Query7previ ewEv+0x1b): In
function `mysqlpp::Query:review()':
: undefined reference to =
`mysqlpp::SQLQuery::str(mysqlpp::SQLQueryParms&)'

I believe mysql++ will be perfect for what I am trying to do so any
assistance getting this code up and running would really be appreciated.


----- Original Message -----
From: "Mike Kinney" <kinneym (AT) redacesolutions (DOT) com>
To: "Dennis McFall" <dennis.mcfall (AT) interclay (DOT) com>
Sent: Monday, March 28, 2005 2:35 PM
Subject: Re: zlib and mysql++ build process


Quote:
If you're using the zlib from Fedora, then make sure /usr/local/lib
and /usr/lib are in /etc/ld.so.conf file (and run "ldconfig"!)

It *looks* like you need to do "-lzlib" not "-lz".

For what it's worth, I think you *can* migrate up to the 4.xx series,
but simply have to put in that stinkin' "old_passwords=3D1" in
your /etc/my.cnf file.

Hope that helps!

On Mon, 2005-03-28 at 13:35 -0600, Dennis McFall wrote:
I am attempting to build mysql++ on a Fedora Core 2 machine. The
following rpms have been installed:

mysql++-1.7.32-1
mysql-devel-3.23.58-9
mysql-3.23.58-9
mysql-server-3.23.58-9
php-mysql-4.3.4-11
mysql++-devel-1.7.32-1
MySQL-shared-3.23.58-1

I have to stay with MYSQL version 3.23.58 due to the existing
installbase.



The configure.h file that is generated states that I do not have =
support
for zlib, however, I do, as the "rpm -qa" shows below.
Quote:
rpm -qa | grep zlib*
zlib-1.2.1.1-2.1


The make process fails to complete because ld can't find -lz.

/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [libmysqlpp.la] Error 1
make[2]: Leaving directory `/home/insite/temp/mysql++-1.7.32/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/insite/temp/mysql++-1.7.32'
make: *** [all] Error 2

I attempted to show "configure" where the zlib.h file is by adding =
an
"--includedir" option but this did not help.
Quote:
./configure '--includedir=3D/usr/local/include/mysql++'
'--includedir=3D/lib/modules/2.6.5-1.358/build/include/linux/' =
--enable-thread
-check
Quote:
Any suggestions?
--
Mike Kinney
www.RedAceSolutions.com
Phone (503) 590-5606 x201

------=_NextPart_000_0038_01C533AE.75A83090--




Reply With Quote
  #4  
Old   
Ed Terchunian
 
Posts: n/a

Default Re: zlib and mysql++ build process - 03-28-2005 , 11:20 PM



You might want to tack a -lmysqlpp onto that compilation, i.e.

g++ -o dbtest dbtest.cpp -lmysqlpp

It won't link the library unless you tell it to.

In the future you should probably refer to the example programs provided
with the package, they seem to answer all of my questions.



Ed Terchunian

Dennis McFall wrote:

Quote:
After installing the Fedora Core 2 zlib dev package I was able to
successfully compile mysql++.

I still went ahead and added the two new path entries to the ld.so.conf file
and executed ldconfig.

Encouraged, I tried to compile my dbtest.cpp test program but still
encountered many errors. I have not
been able to determine what is going on even though I have tried for most of
the day. Unfortunately, in this case, my forte` is windows development
and not linux development. I may have screwed something up (versioning etc)
while I was trying to staisfy all the rpm dependencies. This machine was
not originally setup for development so I had to load gcc and everything it
depended on.

I am simply trying to use some of the sample code to connect to my local
database and execute a select query. The code is below:

#include <iostream
#include <iomanip
#include <mysql++.h

using namespace mysqlpp;
using namespace std;

int main()
{
Connection con("test","localhost","test","test");
// The full format for the Connection constructor is
// Connection(cchar *db, cchar *host="",
// cchar *user="", cchar *passwd="")
// You may need to specify some of them if the database is not on
// the local machine or you database username is not the same as your
// login name, etc..

Query query = con.query();
// This creates a query object that is bound to con.

query << "SELECT * FROM monitor";
// You can write to the query object like you would any other ostrem

Result res = query.store();
// Query::store() executes the query and returns the results

cout << "Query: " << query.preview() << endl;
// Query:review() simply returns a string with the current query
// string in it.

cout << "Records Found: " << res.size() << endl << endl;

Row row;
cout.setf(ios::left);
cout << setw(10) << "monitor_id"
setw(1) << "monitor_type"
setw(50) << "monitor_title"
setw(4) << "monitor_status"
setw(4) << "monitor_email"
setw(10) << "monitor_day_ttl"
setw(10) << "monitor_week_ttl"
setw(10) << "monitor_month_ttl" << endl;

Result::iterator i;
// The Result class has a read-only Random Access Iterator
for (i = res.begin(); i != res.end(); i++) {
row = *i;
cout << setw(10) << row["monitor_id"]
setw(10) << row["monitor_type"]
setw(50) << row["monitor_title"]
setw(4) << row["monitor_status"]
setw(4) << row["monitor_email"]
setw(10) << row["monitor_day_ttl"]
setw(10) << row["monitor_week_ttl"]
setw(10) << row["monitor_month_ttl"] << endl;
}
return 0;
}

The errors I am getting are shown below:

[root@localhost temp]# g++ -o dbtest dbtest.cpp
/tmp/ccIwAWIf.o(.text+0x35): In function `main':
: undefined reference to `mysqlpp::Connection::Connection[in-charge](char
const*, char const*, char const*, char const*, bool)'
/tmp/ccIwAWIf.o(.text+0x4e): In function `main':
: undefined reference to `mysqlpp::Connection::query()'
/tmp/ccIwAWIf.o(.text+0x700): In function `main':
: undefined reference to `mysqlpp::Connection::~Connection [in-charge]()'
/tmp/ccIwAWIf.o(.text+0x79f): In function `main':
: undefined reference to `mysqlpp::Connection::~Connection [in-charge]()'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowC1Ev+0x2 c): In function
`mysqlpp::Row::Row[in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowC1Ev+0x3 8): In function
`mysqlpp::Row::Row[in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowD1Ev+0xc ): In function
`mysqlpp::Row::~Row [in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp3RowD1Ev+0x1 8): In function
`mysqlpp::Row::~Row [in-charge]()':
: undefined reference to `vtable for mysqlpp::Row'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp6ResultD1Ev+ 0x1a): In function
`mysqlpp::Result::~Result [in-charge]()':
: undefined reference to `mysqlpp::ResUse::~ResUse [not-in-charge]()'
/tmp/ccIwAWIf.o(.gnu.linkonce.t._ZN7mysqlpp5Query7previ ewEv+0x1b): In
function `mysqlpp::Query:review()':
: undefined reference to `mysqlpp::SQLQuery::str(mysqlpp::SQLQueryParms&)'

I believe mysql++ will be perfect for what I am trying to do so any
assistance getting this code up and running would really be appreciated.


----- Original Message -----
From: "Mike Kinney" <kinneym (AT) redacesolutions (DOT) com
To: "Dennis McFall" <dennis.mcfall (AT) interclay (DOT) com
Sent: Monday, March 28, 2005 2:35 PM
Subject: Re: zlib and mysql++ build process




If you're using the zlib from Fedora, then make sure /usr/local/lib
and /usr/lib are in /etc/ld.so.conf file (and run "ldconfig"!)

It *looks* like you need to do "-lzlib" not "-lz".

For what it's worth, I think you *can* migrate up to the 4.xx series,
but simply have to put in that stinkin' "old_passwords=1" in
your /etc/my.cnf file.

Hope that helps!

On Mon, 2005-03-28 at 13:35 -0600, Dennis McFall wrote:


I am attempting to build mysql++ on a Fedora Core 2 machine. The


following rpms have been installed:


mysql++-1.7.32-1
mysql-devel-3.23.58-9
mysql-3.23.58-9
mysql-server-3.23.58-9
php-mysql-4.3.4-11
mysql++-devel-1.7.32-1
MySQL-shared-3.23.58-1

I have to stay with MYSQL version 3.23.58 due to the existing


installbase.



The configure.h file that is generated states that I do not have support


for zlib, however, I do, as the "rpm -qa" shows below.


rpm -qa | grep zlib*
zlib-1.2.1.1-2.1


The make process fails to complete because ld can't find -lz.

/usr/bin/ld: cannot find -lz
collect2: ld returned 1 exit status
make[2]: *** [libmysqlpp.la] Error 1
make[2]: Leaving directory `/home/insite/temp/mysql++-1.7.32/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/insite/temp/mysql++-1.7.32'
make: *** [all] Error 2

I attempted to show "configure" where the zlib.h file is by adding an


"--includedir" option but this did not help.


./configure '--includedir=/usr/local/include/mysql++'


'--includedir=/lib/modules/2.6.5-1.358/build/include/linux/' --enable-thread
-check


Any suggestions?


--
Mike Kinney
www.RedAceSolutions.com
Phone (503) 590-5606 x201







--
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   
Warren Young
 
Posts: n/a

Default Re: zlib and mysql++ build process - 03-29-2005 , 07:56 AM



Dennis McFall wrote:

Quote:
[root@localhost temp]# g++ -o dbtest dbtest.cpp
See examples/Makefile.simple for the proper build commands.

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