[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fw: Fw: gnuvoice again




since I've been working on this, thought I would forward something I got
for hashing over by everybody

> ----- Original Message -----
> From: Ferenc Cserepkei <ferenccserepkei@webwizint.com>
> To: Doug Daniel <dougdaniel@webwizint.com>
> Cc: <zsolthuszar@mail.webwizint.com>
> Sent: Thursday, April 06, 2000 10:26 AM
> Subject: *Re: Fw: gnuvoice again
> >
> > Hi Matt,
> >
> > >> > In file included from MysqlConnection.h:25,
> > >> >                  from GtkModel.C:36:
> > >> > /usr/include/mysql/mysql.h:17: conflicting types for `typedef char
*
> > >> > string'
> > >> > /usr/include/g++-2/string:9: previous declaration as `typedef
class
> > >> > basic_string
> > >> > <char,string_char_traits<char>,__default_alloc_template<true,0> >
> > >string'
> > >> > make[1]: *** [GtkModel.o] Error 1
> >
> > It seems to me that the source GtkModel.C is a c++ one. And You are
> compiling a C++ program as I see. The C++ language today has a common and
> popular extension, called the Standard Template Library, STL for short.
STL
> defines an object oriented container data type called "string", mainly
for
> handle text data, but it can be used for storing any kind of data what
can
> be threated logically as string text (sequential readable information).
So,
> within a C++ software, "string" should be threated as a data type and
cannot
> be used as a name of a variable. The mysql header file violates this
rule,
> because uses variable "string".
> > Workaround:
> > METHOD 1:
> > ---------
> > copy /usr/include/mysql/mysql.h to /usr/include/mysql/mysql
> > edit the copy as follows:
> > Original structure
> >
> > #IFNDEF SOME_PRPEPROCESSOR_VARIABLE
> > #DEFINE SOME_PREPROCESSOR_VARIABLE
> > :
> > .
> > header body
> > :
> > .
> > #ENDIF:
> >
> >
> > new stucture:
> > #IFNDEF SOME_PRPEPROCESSOR_VARIABLE
> > #DEFINE SOME_PREPROCESSOR_VARIABLE
> > namespace MYSQL {
> > :
> > .
> > header body
> > :
> > .
> > }
> > #ENDIF
> >
> >
> > Look for the GnuVoice including mysql.h
> >
> > change
> > #include <mysql/mysql.h>
> > to
> > #include <mysql/mysql>
> >
> >
> > Consult the code. You have to modify identifiiers (variables, types,
> structs) what was referrerred to the mysql.h
> > Ie:
> > Let's assume that we have a type foo defined in mysql.h and You have
> > such a definition
> > foo bar;
> > at GtkModel.C. You have to change it to:
> > MYSQL::foo bar;
> > :
> > .
> > MYSQL::string = "foobar\n";
> >
> > As we have put all of mysql interface elements into the "MYSQL"
> > namespace we will have no more conflitcts with STL's standard
> > namespace aka "std".
> > The reason for Your problem is that, until further declarations
> > g++ assumes "std" as the default namespace for all of your sources.
> >
> > Of course, for your ill fortune you have to add a senetence:
> > using namespace MYSQL;
> > to the beginnig of all of your mysql C sources and You have to
> > recompile the whole mysql as c++ application.
> >
> >
> > METHOD 2:
> > ---------
> > Alternative solution, to find every occurrence of "string" in all off
your
> mysql sources and replace to something else, and recompile mysql as c.
> >
> > Of course You have to modify GnuVoice sources referring the "string"
type
> and have to do the same rpelacement.
> >
> >
> > The bad thing, that after both of the methods, You will have a new
wersion
> of mysql which one is incompatible with the common used one.
> >
> > The name of the maintainer of mysql should be read somewhere in the
> sources or README, INSTALL, COPYING etc files. If You could, please
notify
> Him/Her about this problem.
> >
> > Regards:
> > Ferenc
> >
> >
> >

--
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.