8 messages in com.mysql.lists.plusplusRE: Compile Error/Code Issue
FromSent OnAttachments
gary clark14 Nov 2006 15:00 
gary clark15 Nov 2006 15:14 
Freyja15 Nov 2006 23:29 
Joel Fielder16 Nov 2006 00:46 
Warren Young16 Nov 2006 03:06 
gary clark16 Nov 2006 07:20 
Freyja16 Nov 2006 17:18 
Joel Fielder17 Nov 2006 00:38 
Subject:RE: Compile Error/Code Issue
From:Joel Fielder (joel@switchplane.com)
Date:11/16/2006 12:46:24 AM
List:com.mysql.lists.plusplus

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 mysqlpp::Connection.

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 :)

Joel