Compilation Error using ANN Approximate nearest neighbour library

From: Travis Stewart (m0f14_at_unb.ca)
Date: 06/09/04


Date: Wed, 09 Jun 2004 11:01:53 -0300

Hi,
I am not very familiar with C++ so the problems I am having might be
simple and I just cannot see them or I am totally unaware of why something
would be incorrect. Anyway, I'm using the ANN approximate nearest
neighbour libraries written by David Mount and Sunil Arya. In the ANN.h
file there is a comment describing how the data types used to represent
the coordinates and distances between points can be modified by the user.
For my use of library it would be most convientent to use a float instead
of the default double type. When I compile the program initially with the
original settings I do not get errors, but when I modify the header file
for the float type I get the error:

[stewart@samples]$ g++ ann_sample.cc -I/home/stewart/ANN/include
-L/home/stewart/ANN/lib -lANN -Wno-deprecated
/tmp/ccrhNdym.o(.text+0x123): In function `main':
: undefined reference to `annAllocPt(int, float)'
/tmp/ccrhNdym.o(.text+0x1e0): In function `main':
: undefined reference to `ANNkd_tree::ANNkd_tree[in-charge](float**, int,
: int, i
nt, ANNsplitRule)'
collect2: ld returned 1 exit status

The program I am using and the modified header file (the types of
ANNcoord and ANNdist are now float, and ANN_DIST_INF is now MAXFLOAT) are
rather long so I have links to each.

http://v5o5jotqkgfu3btr91t7w5fhzedjaoaz8igl.unbf.ca/~m0f14/ANN.h
http://v5o5jotqkgfu3btr91t7w5fhzedjaoaz8igl.unbf.ca/~m0f14/ann_sample.cc

Thanks for any help,
Travis



Relevant Pages

  • Re: Why isnt my compiler warning me about this?
    ... > In the following code snippet, I declare the variable val as float in ... > the calc.h header file, ... I get no errors about the difference between float and int. ...
    (comp.lang.c)
  • Re: Compiling template function
    ... > float v; ... the entire template goes into the header file. ... it's dealt with entirely by the compiler, ...
    (comp.lang.cpp)
  • Use libstruct
    ... I would load un structure pointer via a mex-file and his header file. ... The structure is'nt so symply that this given in the exemple code in ...
    (comp.soft-sys.matlab)
  • Use libstruct with an array in a structure
    ... I would load un structure pointer via a mex-file and his header file. ... The structure is'nt so symply that this given in the exemple code in ...
    (comp.soft-sys.matlab)
  • Re: Header Files Dependency Ignored in Command Line Build
    ... I have checked the command with an .sln, ... account all the source files using a modified header file .h. ...
    (microsoft.public.vstudio.development)