List:MySQL++« Previous MessageNext Message »
From:Ronny Bremer Date:April 10 2007 7:48am
Subject:Compile error with Metrowerks Codewarrior
View as plain text  
Hi there,

I have searched the mailing list for several hours, and obviously, the issue I am having
is known. However, the default solution "upgrade you GCC compiler" does not help me, cause
the compiler I am using is Metrowerks Codewarrior, and it can not be upgraded so easily.

I am using the current release of the mysql-c++ library (2.2.1) and am trying to compile
it for Netware.

First issue I found (but I could solve): in "query.h" there is a template function at line
708 defined like this:

template <class Sequence>
void Query::storein_sequence(Sequence& con, const char* s)

For some reason, the Codewarrior compiler complains about the typename statement at line
con.push_back(typename Sequence::value_type(row));

Error message is: Unknown identifier Sequence

So I changed the template parameter from Sequence to T, and it works. Strange, right?

Anyway, the second issue is what others have reported in the past.
When compiling custom1.cpp the following error occurs:

..\..\test\stock.h:47: illegal explicit conversion from 'const
mysqlpp::ColData_Tmpl<mysqlpp::const_string>' to
..\..\test\stock.h:47: 'std::basic_string<char, std::char_traits<char>,
..\..\test\stock.h:47:  (point of instantiation: 'stock::stock(const mysqlpp::Row &)')
..\..\test\stock.h:47:   (instantiating: 'populate_stock<0>(stock *, const
mysqlpp::Row &)')

As I said in my introduction, I cannot upgrade the compiler and it is fairly standard
based. For those interested, I am using this version:
Metrowerks C/C++ Compiler for Netware/x86.
Copyright (c) 2003, Metrowerks Corporation
All rights reserved.
Version 3.0.3 build 383 (Build Build 383)
Runtime Built: Dec 11 2003 11:36:25

I tried to understand the meaning behind the ColData_Tmp<const_string> template
class trying to static_cast to a basic_string, but I could not find a function like that.
All I can find is a member function from ColData_Tmp<const_string> to cchar (const
Could that be the issue, that later versions of GCC do accept this and maybe some other
compilers dont?

I tried with both ansi strict and ansi off, and also tried MSC compatibility options. No

Any insight would be highly appreciated.

Thanks in advance,

Compile error with Metrowerks CodewarriorRonny Bremer10 Apr
  • Re: Compile error with Metrowerks CodewarriorWarren Young10 Apr
    • Re: Compile error with Metrowerks CodewarriorWarren Young10 Apr
    • Re: Compile error with Metrowerks CodewarriorRonny Bremer10 Apr