Mail Archives: djgpp/1998/04/11/15:15:23
S.G wrote:
> Hi, I'm new to C++ programming and to the Djgpp environment.
> I have created project inside the rhide and tried to compile and
> link it, however, there were some errors showed up and I don't
> know what it means and how to solve it.
> I have included the appropriate .h files in the main. Here are the
> errors:
>
> atest.cc:10: undefined reference to `Heap<int>::BinaryHeap(int)'
> atest.cc:12: undefined reference to `Heap<int>::Insert(int)'
> atest.cc(.text+0x56): undefined reference to `Heap<int>::Insert(int)'
> c:/djgpp/tmp\ccdaaaaa(.text+0x80):atest.cc: more undefined references
> to `Heap<int>::Insert(int)' follow
> c:/djgpp/tmp\ccdaaaaa: In function `main':
> atest.cc:20: undefined reference to `Heap<int>::FindMin(void)'
> atest.cc:21: undefined reference to `Heap<int>::DeleteMin(void)'
>
> the heap.h files contains a template class declaration of Heap.
>
This looks like typical Link problem. (the undefined reference message,
came from Linker, indeed.) . There can be some reason for this,
lib file not exist or, command line syntax... etc.
I can't figure out what is, in your case. consult Djgpp FAQ, linker
problem,
and more. most linker error can be solved by FAQ.
nayas
- Raw text -