www.digitalmars.com         C & C++   DMDScript  

c++ - MySQL++

reply Michael Comperchio <mcmprch adelphia.net> writes:
In trying to compile the example code for MySQL (the "simple1.cpp") I 
get the following errors (from the code posted after them:

I guessed at the compiler switches,

ERRORS_____________________________
sc simple1.cpp -Ar -mn -C -WA -S -3 -a8 -c -gf -D_CONSOLE=1 
-Ic:\mysql\include -osimple1.obj
Error: D:\MYSQL\type_info1.hh(18): ';' expected following declaration of 
struct member
Error: D:\MYSQL\type_info1.hh(32): ')' expected
Error: D:\MYSQL\type_info1.hh(34): '_c_type' is not a member of struct 
'mysql_ti_sql_type_info'
Error: D:\MYSQL\type_info1.hh(38): ')' expected
Fatal Error: D:\MYSQL\type_info1.hh(39): too many errors
Lines Processed: 126492  Errors: 5  Warnings: 0
Build failed



CODE_______________________________

#ifndef __type_info1_hh__
#define __type_info1_hh__

#include <mysql.h>

#include <typeinfo.h>
#include <map.h>
//using namespace std;

class mysql_type_info;
class mysql_ti_sql_type_info_lookup;

class mysql_ti_sql_type_info {
   friend mysql_type_info;
   friend mysql_ti_sql_type_info_lookup;
private:
   const char          * _sql_name;
   const type_info     * _c_type;
   const unsigned char  _base_type;
   const bool           _default;

   // VISUAL C++ fix: default and copy constructor may not be made private
   // otherwise, linker errors will occur

   //mysql_ti_sql_type_info (const mysql_ti_sql_type_info &b); 
  // can't do
   mysql_ti_sql_type_info& operator=(const mysql_ti_sql_type_info &b); 
//  "    "
   //mysql_ti_sql_type_info () {}
   // OEP - didn't init _base_type and _default mysql_ti_sql_type_info () {}
   // all private, only mysql_type_info can
   // create because there *must* be only one copy
   // of each.
   mysql_ti_sql_type_info (const char *s, const type_info &t,
			  const unsigned char bt = 0,  const bool d = false )
     : _sql_name(s), _c_type(&t), _base_type(bt), _default(d) {}
};
Sep 12 2002
next sibling parent Christof Meerwald <cmeerw web.de> writes:
On Thu, 12 Sep 2002 21:30:21 -0400, Michael Comperchio wrote:
 In trying to compile the example code for MySQL (the "simple1.cpp") I 
 get the following errors (from the code posted after them:
 ERRORS_____________________________
 sc simple1.cpp -Ar -mn -C -WA -S -3 -a8 -c -gf -D_CONSOLE=1 
 -Ic:\mysql\include -osimple1.obj
 Error: D:\MYSQL\type_info1.hh(18): ';' expected following declaration of 
 struct member

[...]
 CODE_______________________________

    const type_info     * _c_type;

DM's RTTI implementation currently isn't standards compliant - it uses Type_info instead of std::type_info. bye, Christof -- http://cmeerw.org JID: cmeerw jabber.at mailto cmeerw at web.de ...and what have you contributed to the Net?
Sep 13 2002
prev sibling parent "Walter" <walter digitalmars.com> writes:
type_info is probably undefined.

"Michael Comperchio" <mcmprch adelphia.net> wrote in message
news:3D813FAD.50604 adelphia.net...
 In trying to compile the example code for MySQL (the "simple1.cpp") I
 get the following errors (from the code posted after them:

 I guessed at the compiler switches,

 ERRORS_____________________________
 sc simple1.cpp -Ar -mn -C -WA -S -3 -a8 -c -gf -D_CONSOLE=1
 -Ic:\mysql\include -osimple1.obj
 Error: D:\MYSQL\type_info1.hh(18): ';' expected following declaration of
 struct member
 Error: D:\MYSQL\type_info1.hh(32): ')' expected
 Error: D:\MYSQL\type_info1.hh(34): '_c_type' is not a member of struct
 'mysql_ti_sql_type_info'
 Error: D:\MYSQL\type_info1.hh(38): ')' expected
 Fatal Error: D:\MYSQL\type_info1.hh(39): too many errors
 Lines Processed: 126492  Errors: 5  Warnings: 0
 Build failed



 CODE_______________________________

 #ifndef __type_info1_hh__
 #define __type_info1_hh__

 #include <mysql.h>

 #include <typeinfo.h>
 #include <map.h>
 //using namespace std;

 class mysql_type_info;
 class mysql_ti_sql_type_info_lookup;

 class mysql_ti_sql_type_info {
    friend mysql_type_info;
    friend mysql_ti_sql_type_info_lookup;
 private:
    const char          * _sql_name;
    const type_info     * _c_type;
    const unsigned char  _base_type;
    const bool           _default;

    // VISUAL C++ fix: default and copy constructor may not be made private
    // otherwise, linker errors will occur

    //mysql_ti_sql_type_info (const mysql_ti_sql_type_info &b);
   // can't do
    mysql_ti_sql_type_info& operator=(const mysql_ti_sql_type_info &b);
 //  "    "
    //mysql_ti_sql_type_info () {}
    // OEP - didn't init _base_type and _default mysql_ti_sql_type_info ()

    // all private, only mysql_type_info can
    // create because there *must* be only one copy
    // of each.
    mysql_ti_sql_type_info (const char *s, const type_info &t,
   const unsigned char bt = 0,  const bool d = false )
      : _sql_name(s), _c_type(&t), _base_type(bt), _default(d) {}
 };

Sep 13 2002