![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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. |
![]() |
| Thread Tools | |
| Display Modes | |
| |