Try to check if your libcppdb.so is in /usr/lib folder or not?
I assume you are using Linux.
陈抒
Best regards
http://blog.csdn.net/sheismylife
On Thu, Aug 11, 2011 at 7:56 AM, Daniel Rios <dan...@li...> wrote:
> Hello there!,
>
> Im trying to run a simple example of cppDB with mysql. First cppDB
> installation was a PITA because the
> "mysql_client library was not found, disabling mysql backend, " cmake
> message.
> Since I'm a newbie in the GNU development, I've had to use saint google to
> found the solution..
> and that was install mysql development libraries.
>
> Anyway here's the source code I tried to run without success
>
> #include <cppdb/frontend.h>
> #include <iostream>
> #include <ctime>
>
> int main()
> {
> try {
> cppdb::session
> sql("mysql:user=root;password=danielito;opt_reconnect=1;opt_read_timeout=10;opt_compress=1");
>
>
> time_t now_time = std::time(0);
>
> std::tm now = *std::localtime(&now_time);
>
> cppdb::result res = sql << "SELECT id_enviroment, env_type,
> name FROM db_enviroment";
>
> while(res.next()) {
> double f=-1;
> int id,k;
> std::tm atime;
> std::string name;
> //res >> id >> k >> f >> atime >> name;
>
> res >> id >> k >> name;
> std::cout <<id << ' '<<k <<' '<<name << std::endl;
> }
>
> }
> catch(std::exception const &e) {
> std::cerr << "ERROR: " << e.what() << std::endl;
> return 1;
> }
> return 0;
> }
>
> Compilation with:
> g++ dbtest.cpp -lcppdb -o dbtest
>
> Run with
> ./dbtest
> ERROR: cppdb::driver failed to load driver mysql - no module found
>
> Im doing it right ?
>
> Thanks !
>
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it.
> http://p.sf.net/sfu/wandisco-dev2dev
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
>
>
|