List:MySQL++« Previous MessageNext Message »
From:Totte Karlsson Date:August 20 2004 6:51pm
Subject:Re: dll problems with borland 6
View as plain text  
Hi, I made some other changes

1)
in convert1.hh and defs.hh
#include <defs.hh> and <mysql.h>

was changed to
#include "defs.hh" and "mysql.h" respectively.
There seems to be a general use of <> when including non system headers
troughout the library. I think they should all be changed into "" where
appropriate.
======================
2)
The line (75) in resiter1.hh
        ReturnType operator -> () const {return &((*d)[i]);}
gives a compile error for some of the examples.

The error reads
  [C++ Error] resiter1.hh(75): E2028 operator-> must return a pointer or a
class
  [C++ Error] simple1.cpp(50): E2450 Undefined structure
'subscript_iterator<const const_subscript_container<MysqlRes,MysqlRow,const
MysqlRow,unsigned int,int>,const MysqlRow,unsigned int,int>'
  [C++ Error] simple1.cpp(50): E2449 Size of 'iter' is unknown or zero
  [C++ Error] simple1.cpp(50): E2450 Undefined structure
'subscript_iterator<const const_subscript_container<MysqlRes,MysqlRow,const
MysqlRow,unsigned int,int>,const MysqlRow,unsigned int,int>'
  [C++ Error] simple1.cpp(72): E2451 Undefined symbol 'er'

Commenting out the line removes all errors. I had not time to see what was
going on there. Should it not just simply read (will make it compile)
        ReturnType* operator -> () const {return &((*d)[i]);}
==========================
3)
Renamed mysql++.hh to mysql++.h and changed each example file including the
file. (I find .hh unconventional for a user header file).
===========
4)
In Sql_query.cc in function std::string SQLQuery::str(const SQLQueryParms
&p) const {
line 110-113

  const_this->get(s, length, '\0');
  const_this->seekg (0,std::ios::beg);
  const_this->seekp (-1,std::ios::cur);
  return std::string(s);

was changed to

  const_this->get(s, length, '\0');
  const_this->seekg (0,std::ios::beg);
  const_this->seekp (-1,std::ios::cur);

  std::string aStr(s);
  delete [] s;
  return aStr;

The #def __USLC__ results in a memory leak. The char* s is newed but never
deleted! I have seen that at other places in the code as well.


"Warren Young" <mysqlpp@stripped> wrote in message
news:41254626.4060609@ style="color:#666">stripped...
> Totte Karlsson wrote:
> >
> > 1) In ColData.cc I added
> > #include <windows.h>
>
> What exactly was the error you got without this?  I can't formulate a
> good cross-platform patch based on this report.

Instead of including windows.h I added
#ifdef __WIN32__
#include <winsock.h>
#endif
at the top of the coldata.cc file. That seems to be consistent with other
.cc files in the library

> > 3)
> > the header include
> > #include <ext/slist>
> > in connection.hh
> > was changed to
> > #include <slist>
>
> The right fix is more complicated.  I'll add it to .13.
>

The slist is not a standard header and is not part of the C++ standard. it
is an SGI extension..


> > in convert.hh
> > the lines
> > mysql__convert(float, strtod)
> > ...
> > were changed into
> > ...
> > mysql__convert(float, std::strtod)
>
> That shouldn't be necessary.  Try adding #include <stdlib.h> to the top
> of the file.  strtod is only in namespace std if you include cstdlib
> instead, and I see no good reason to use that in this case.

Tried it, but it does not work. It gives the same conflict.

>
> >   [C++ Warning] null1.hh(16): W8058 Cannot create pre-compiled header:
> > initialized data in header
>
> That can be fixed with a project setting.
>
it complains about this line
const null_type null = null_type();


> Speaking of the project file, are you going to send it to me?

I put a .zip file at
http://www.codeschack.com/public/

You can find project files for the library and the examples in there, as
well as all other files.
Any Borland user has to define macros (under IDE user variables) for the
"main" sql installation directory, e.g. MySQL = c:\mysql
and also change where the .lib file is being created.

>
> >   [TLib Warning] public '_STL::operator
> > <<(_STL::basic_ostream<_STL::char_traits<...' in module
> 'connection'
clashes
> > with prior module 'coldata'
>
> I'm not sure what this one means.  Would you please do some research on
> this and get back to me?  I suspect it's a common problem in many
> projects (i.e. not MySQL++ specific), but I can't guess at the fix since
> I don't use BCB.

Will look into this one...


cheers
-totte



Thread
dll problems with borland 6Totte Karlsson19 Aug
  • Re: dll problems with borland 6Warren Young19 Aug
  • Re: dll problems with borland 6Totte Karlsson19 Aug
    • Re: dll problems with borland 6Warren Young19 Aug
  • Re: dll problems with borland 6Totte Karlsson20 Aug
    • Re: dll problems with borland 6Warren Young20 Aug
  • Re: dll problems with borland 6Totte Karlsson20 Aug
    • Re: dll problems with borland 6Warren Young20 Aug
  • Re: mysql++ on sourceforgeSteffen Neumann26 Oct
  • Re: mysql++ on sourceforgePaolo Brandoli26 Oct