libann-users
[Top][All Lists]
Advanced

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

Re: [libann-users] *** COMPILATION PROBLEM (another one!)


From: Pier Luca Lanzi
Subject: Re: [libann-users] *** COMPILATION PROBLEM (another one!)
Date: Fri, 04 Mar 2005 11:57:40 +0100

I guess that the problem is the new G++, V3.4.1.

I tried compilation on a previous version, 3.2.2, and obtained errors
which required small code modifications: I needed to put explicit cast
to double in the calls of sqrt and exp functions.

But with this version there was no error in persist.cc!

Any clue of what's happening with 3.4.1?

Thank you!
PLL

PS
Here come the errors I got:

make YACC=bison
CPPFLAGS="-I /usr/local/include -I . -I ." ./generate-depends.sh
ann/mlp.cc ann/mlp.d .
g++ -c  -I /usr/local/include -I . -I . -g ann/mlp.cc -o ann/mlp.o
ann/mlp.cc: In member function `virtual float
ann::Sigmoid::operator()(float)
   const':
ann/mlp.cc:59: call of overloaded `exp(int)' is ambiguous
/usr/include/bits/mathcalls.h:101: candidates are: double exp(double)
/usr/include/c++/3.2.2/cmath:229:                 long double
std::exp(long
   double)
/usr/include/c++/3.2.2/cmath:221:                 float std::exp(float)
make: *** [ann/mlp.o] Error 1

CPPFLAGS="-I /usr/local/include -I . -I ." ./generate-depends.sh
ann/kohonen.cc ann/kohonen.d .
g++ -c  -I /usr/local/include -I . -I . -g ann/kohonen.cc -o
ann/kohonen.o
ann/kohonen.cc: In member function `void ann::Kohonen::train(const
   std::set<ann::ExtInput, std::less<ann::ExtInput>,
   std::allocator<ann::ExtInput> >&, float, float, float, float) const':
ann/kohonen.cc:139: call of overloaded `sqrt(const int&)' is ambiguous
/usr/include/bits/mathcalls.h:157: candidates are: double sqrt(double)
/usr/include/c++/3.2.2/cmath:465:                 long double
std::sqrt(long
   double)
/usr/include/c++/3.2.2/cmath:461:                 float std::sqrt(float)

which basically required simply to put a cast to double in the arguments
of exp and sqrt functions.


On Fri, 2005-03-04 at 07:15 +0800, John Darrington wrote:
> On Wed, Mar 02, 2005 at 03:22:48PM +0100, Pier Luca Lanzi wrote:
>      Hi!
>      
>      here I come with another compilation error. 
>      
>      I am trying to compile libann. 
>      
>      I use the command "make YACC=bison" which solves the problem I
>      previously asked support for. 
>      
> Good.
> 
>      Now the compilation stops and report an error at line 48 of persist.cc
>      
>      The problem regards the line 48:
>      
>            "is.get(static_cast<char>(data[i]));"
>      
> I don't understand this.
> 
>      
>      g++ -c  -I /usr/local/include -I . -I . -g ann/persist.cc -o
>      ann/persist.o
>      ann/persist.cc: In function `void ann::_read(std::istream&, unsigned
>      char*, int)':
>      ann/persist.cc:48: error: no matching function for call to
>      `std::basic_istream<char, std::char_traits<char> >::get(char)'
>      /usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1/../../../../include/c
>      ++/3.4.1/bits/istream.tcc:441: note: candidates are: typename
>      std::basic_istream<_CharT, _Traits>::int_type std::basic_istream<_CharT,
>      _Traits>::get() [with _CharT = char, _Traits = std::char_traits<char>]
>      /usr/lib64/gcc/x86_64-mandrake-linux-gnu/3.4.1/../../../../include/c
>      ++/3.4.1/bits/istream.tcc:472: note:
>      std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT,
> 
>      _Traits>::get(_CharT&) [with _CharT = char, _Traits =
>      std::char_traits<char>]
> 
> This candidate should match it.  Shouldn't it ??
> 
> 
> Any ideas anyone ?
> 
>      
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]