List:MySQL++« Previous MessageNext Message »
From:Joel Fielder Date:November 16 2006 8:46am
Subject:RE: Compile Error/Code Issue
View as plain text  
I'm sure these are just c++ errors as opposed to anything mysql++
related - if so you should follow this up on a c++ list somewhere.

Error 1, exactly what it says on the tin, constructors can't return a
value of any type so just remove the "return -1;".  Personally, I'd let
whatever instanciates DatabaseControl handle the exception (or at least
re-throw it), but otherwise making that change will correct the error.

I think error 2 is because "con" is a pointer, probably you need to use
con->query().  I think error 3 you're missing the header file for

Also, because you're shadowing the "con" member variable in the
constructor it is probably not allocated anywhere.  Result: app will
probably crash when you call getCommands or DatabaseControl goes out of
scope :)  Enjoy more, and turn on -Wshadow to have the compiler let you
know about it.  Turn on -Wall for that matter :)


Problems with mysql and mysql++ examplesgary clark14 Nov
  • Compile Error/Code IssueFreyja16 Nov
    • RE: Compile Error/Code IssueJoel Fielder16 Nov
      • Re: Compile Error/Code IssueFreyja17 Nov
        • Re: Compile Error/Code IssueJoel Fielder17 Nov
  • Re: Problems with mysql and mysql++ examplesWarren Young16 Nov
    • Re: Problems with mysql and mysql++ examplesgary clark16 Nov
Re: Problems with mysql and mysql++ examplesgary clark16 Nov