libann-users
[Top][All Lists]
Advanced

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

[libann-users] g++ error: assert not defined


From: Jeff Simpson
Subject: [libann-users] g++ error: assert not defined
Date: Mon, 29 Sep 2003 21:57:54 -0700
User-agent: KMail/1.5.3

FYI, I had to added a couple of things to get my system to build libann.  BTW, 
I saw mentioned to a couple of these ion some earlier threads, but I'll 
include my changes for those who never saw that thread.

System stats:
- Gentoo Linux 1.4
- g++ (GCC) 3.3.1 20030904 (Gentoo Linux 3.3.1-r1, propolice)
- libann 1.4

For the initial errors:

1) Untarred libann-1.4.tar.gz
2) Ran ./configure
3) make

Encountered yacc-age...My system is most likely not configured correctly.

-------------- snip ---------------
yacc -d demos/parse.y -o demos/parse.cc
usage: yacc [-dlrtv] [-b file_prefix] [-p symbol_prefix] filename
make: *** [demos/parse.cc] Error 1
--------------end snip -----------

to solve I changed the 'yacc' command to 'bison' and it worked fine.

4) make

-------------- snip ---------------
ann/ann.cc: In member function `ann::ExtInput& ann::ExtInput::operator=(const
   ann::vector&)':
ann/ann.cc:40: error: `assert' undeclared (first use this function)
ann/ann.cc:40: error: (Each undeclared identifier is reported only once for
   each function it appears in.)
ann/ann.cc: In function `bool ann::operator==(const ann::ExtInput&, const
   ann::vector&)':
ann/ann.cc:56: error: `assert' undeclared (first use this function)
make: *** [ann/ann.o] Error 1
--------------end snip -----------

I had to add "#include <cassert>" to:
        ann/ann.cc:25:#include <cassert>
        ann/outputMap.cc:27:#include <cassert>

5) make
Lastly, I had some errors using the math functions.   Here's the first one:

-------------- snip ---------------
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::getCoordsFromNode(int, 
   int&, int&) const':
ann/kohonen.cc:107: error: call of overloaded `sqrt(const int&)' is ambiguous
/usr/include/bits/mathcalls.h:157: error: candidates are: double sqrt(double)
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/cmath:550: error:       
             long double std::sqrt(long double)
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/include/g++-v3/cmath:546: error:       
             float std::sqrt(float)
--------------end snip -----------

Changed kohonen.cc, line 107: "sqrt" to "::sqrt".

Similarly, changed mpl.cc, line 58: "exp" to "::exp"


I think that was it.  

Hope this is useful to someone.

-Jeff

P.S.  Thanks for a cool library John!





reply via email to

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