dbTalk Databases Forums  

sql_create_# compilation error

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss sql_create_# compilation error in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Joachim Person
 
Posts: n/a

Default sql_create_# compilation error - 03-11-2005 , 08:42 PM






------=_NextPart_000_0000_01C526B5.80E3DC80
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

When having



sql_create_1(user,

1, 1,

string, ip)



I get compilation errors saying



error C2535: 'void user::set(const std::string &)' : member function already
defined or declared MySQLCommunicator.cpp(10) : see declaration of
'user::set'

error C2535: 'user::user(const std::string &)' : member function already
defined or declared MySQLCommunicator.cpp(10) : see declaration of
'user::user'



I have not used / declared / defined this function anywhere else. What could
this error depend on?



Also - How can I convert a CString into the std::string type?


------=_NextPart_000_0000_01C526B5.80E3DC80--



Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: sql_create_# compilation error - 03-11-2005 , 09:34 PM






Joachim Person wrote:
Quote:
error C2535: 'void user::set(const std::string &)' : member function already
defined or declared MySQLCommunicator.cpp(10) : see declaration of
'user::set'
That's because there are some default constructors generated. The "1,
1" part of the sql_create invocation tells it you want a 1-argument
ctor, which conflicts with one of these defaults. You're going to have
to say "1, 0" instead, and give up on having a ctor that can fully
initialize the object.

This problem has been largely ignored because it goes away when you have
more realistic tables, with many columns.

Quote:
Also - How can I convert a CString into the std::string type?
CString foo;
std::string bar;
bar = (const char*)foo;

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.