dbTalk Databases Forums  

Really basic question about libmysqlpp

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


Discuss Really basic question about libmysqlpp in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Steve Mansfield
 
Posts: n/a

Default Really basic question about libmysqlpp - 03-05-2005 , 05:00 AM






Okay, I know this is going to sound really basic, but I'm only just starting
to teach myself C++ and, typically for me, I've decided to do it the hard way
by jumping in the deep end with mysql++ - I'm not a programmer per se, but
willing to learn.

I tried this some months back with mysql++ 1.7.9 and got it working in so far
as I could do a basic query on a database. Got interrupted, just got back to
it after an upgrade to Suse 9.1 and had to re-install mysql++, so now working
with 1.7.30. Of course, my simple program no longer works.

My source code (sqltest2.cpp) compiles without complaint with the command:

g++ -I/usr/local/include/mysql++ -I/usr/include/mysql -lmysqlpp -lmysqlclient
-o sqltest sqltest2.cpp

But when I run it, I get:
error while loading shared libraries: libmysqlpp.so.4: cannot open shared
object file: No such file or directory

libmysqlpp.so.4 and the file it points to, libmysqlpp.so.4.0.0, are
in /usr/local/lib which is in my path.

FWIW, I installed mysql++ with ./configure
--includedir=/usr/local/include/mysql++. I
added /usr/include, /usr/include/mysql, /usr/local/include, /usr/local/include/mysql++, /usr/lib/mysql
and /usr/local/lib to my path (although the compilation fails if I don't also
include the -I switches in the command above).

I don't intend to bother people here with 'please teach me C++' questions, but
I'd at least appreciate some help with getting up and running so that I can
continue to teach myself. So any advice would be appreciated.

--
@+
Steve

--
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   
Earl Miles
 
Posts: n/a

Default Re: Really basic question about libmysqlpp - 03-05-2005 , 12:04 PM






Steve Mansfield wrote:
Quote:
Okay, I know this is going to sound really basic, but I'm only just starting
to teach myself C++ and, typically for me, I've decided to do it the hard way
by jumping in the deep end with mysql++ - I'm not a programmer per se, but
willing to learn.

I tried this some months back with mysql++ 1.7.9 and got it working in so far
as I could do a basic query on a database. Got interrupted, just got back to
it after an upgrade to Suse 9.1 and had to re-install mysql++, so now working
with 1.7.30. Of course, my simple program no longer works.

My source code (sqltest2.cpp) compiles without complaint with the command:

g++ -I/usr/local/include/mysql++ -I/usr/include/mysql -lmysqlpp -lmysqlclient
-o sqltest sqltest2.cpp

But when I run it, I get:
error while loading shared libraries: libmysqlpp.so.4: cannot open shared
object file: No such file or directory

libmysqlpp.so.4 and the file it points to, libmysqlpp.so.4.0.0, are
in /usr/local/lib which is in my path.

FWIW, I installed mysql++ with ./configure
--includedir=/usr/local/include/mysql++. I
added /usr/include, /usr/include/mysql, /usr/local/include, /usr/local/include/mysql++, /usr/lib/mysql
and /usr/local/lib to my path (although the compilation fails if I don't also
include the -I switches in the command above).

I don't intend to bother people here with 'please teach me C++' questions, but
I'd at least appreciate some help with getting up and running so that I can
continue to teach myself. So any advice would be appreciated.

The -I switch (and the corresponding -L switch) only tell the compiler
where the includes and the libraries are. To find the run-time libraries
you have to do one of two things.

1) Set your LD_LIBRARY_PATH to include /usr/local/lib -- that way the
shell knows to look there for libraries for your executable. Be sure to
export the variable if using a sh equivalent.

2) Find you global settings and add it there. It varies from system to
system, but Redhat at least puts these in /etc/ld.so.conf and after you
edit the file you need to run ldconfig to rewrite the cache file.

--
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   
Steve Mansfield
 
Posts: n/a

Default Re: Really basic question about libmysqlpp - 03-05-2005 , 12:43 PM



-------------------
On Saturday 05 March 2005 19:03, Earl Miles wrote:
Quote:
1) Set your LD_LIBRARY_PATH to include /usr/local/lib -- that way the
shell knows to look there for libraries for your executable. Be sure to
export the variable if using a sh equivalent.

2) Find you global settings and add it there. It varies from system to
system, but Redhat at least puts these in /etc/ld.so.conf and after you
edit the file you need to run ldconfig to rewrite the cache file.
Thanks for that. Turns out that /usr/local/lib was already in /etc/ld.so.conf
but I needed to run ldconfig. Okay, now I promise not to bother people until
I've got a proper mysql++ problem! Cheers.

--
@+
Steve

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