List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:December 15 2008 4:25pm
Subject:Re: Compiling my own project
View as plain text  
Ebner.EJ.Johannes@stripped wrote:
>     const char* dbHost[];

This does not do what you think it does.  It declares an 
indeterminately-sized array of pointers to const char, not a pointer to 
const char, a.k.a. a C string.

I could guide you to a C-like fix, but since you're making such a point 
of using C++, I have to ask, why aren't you using std::string?

If you have more questions like this, please take it up in some C++ 
programming forum.

> mysqlpp::Connection dbConn(dbName, dbHost, dbUser, dbPass, dbPort);

This also doesn't do what you think it does.  You will learn what's 
wrong with this on a C++ programming forum, too.

> catch(mysqlpp::ConnectionFailed connFailedEx)

Always catch exceptions by const reference unless you have a specific 
reason not to.

In addition to repeating the above suggestion, I suggest you get and 
read _Effective C++_, _More Effective C++_, and _Effective STL_, all by 
Scott Meyer.
Thread
Compiling my own projectEbner.EJ.Johannes15 Dec
  • Re: Compiling my own projectWarren Young15 Dec
    • AW: Compiling my own projectEbner.EJ.Johannes16 Dec