Does anyone have any experience using MySQL++? It's a wrapper for MySQL commands for use in C++. I can't seem to get them to work on my Ubuntu 6.06 box. Are there any tricks to setting them up? I used apt-get and it claims they are installed, but my program can't seem to find the libraries during compile time. My first thought was that the correct directories were not being included, but I double checked the locations and they have the mysql.h files and the libraries. Any help or comments would be appreciated.
_________________ Nobody expects the Spanish inquisition!
Joined: Sun 08-18-2002 10:33AM Posts: 750 Location: Kansas City, KS
Source: Off Campus
If you're just farting around with 'pure' SQL, you might want to look into SQLite.
_________________ It is by caffeine alone I set my mind in motion.
It is by the beans of Java the thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
I know Red Hat is retarded in that you could have the lib<whatever> package installed but when you go to include code from it, the compiler complains. What you really needed was the lib<whatever>-dev package. I've run into this a couple of times with Ubuntu as well. So try
apt-cache search (name of library)
and see if there's a (name of library)-dev package, then
apt-get install (name of library)-dev
or whatever to get that one.
Why you would install a lib package and not want to include/link to it escapes me, but that's what they do.
Thanks for the tips, but the program still won't compile. Using sqlite or something like that isn't an option, as I am using code that was given to me for a project. My actual error now during compile time is an undefined reference to mysqlpp::Connection::Connection(bool), when I am attempting to create an object that could connect to the database. I checked and I have the -dev packages. Everything should be calling correctly since I am am trying to compile a test program based on the example from the mysql++ website.
_________________ Nobody expects the Spanish inquisition!
1) Double / Triple check paths and the -l. ( I.e. -lmysqlpp)
2) I believe that the order the libraries are listed in is significant.
I.e. if you have: -llibMyLib -lm -lthread -lmysqlpp
linking may fail, but it might work with: -lmysqlpp -llibMyLib -lm -lthread
The linker searches libraries in the order in which they are specified on the command line — the link order. Link order is important in that a library containing an external reference to another library must precede the library containing the definition. This is why libc is typically the last library specified on the linker command line: because the other libraries preceding it in the link order often contain references to libc routines and so must precede it.
Bill
Last edited by bsiever on Mon 09-18-2006 8:38PM, edited 2 times in total.
Users browsing this forum: No registered users and 1 guest
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum