Hi all ...
Hey, this could be a really stupid question, but I dont care, all I need
is help please ...
I have 3 files: adt.h, adt.cpp, and driver.cpp in my linux box.
driver.cpp includes adt.h, and adt.cpp also includes adt.h.
adt.cpp is the implementation of several data structures as C++ templates
(i.e. template <TYPE> class List ... etc.) and adt.h is its definition
file.
inside driver.cpp i declare a variable of type List<rec> where rec is
just a structure. The problem I am having is during compilation using g++.
I have tried creating a different adt.h and adt.cpp files that are not
'templates' and it worked. But I would like to keep the d.s. as templates.
Here's the output ... any clues??? Thanks
g++ -g -c driver.cpp
g++ -I. -I /usr/include -g -c adt.cpp
g++ -g -o driver driver.o adt.o
driver.o: In function `main':
/u/mrbenji/tools/driver.cpp:13: undefined reference to
`List<rec>::List(void)'
/u/mrbenji/tools/driver.cpp:17: undefined reference to
`List<rec>::Insert(int, r
ec &)'
/u/mrbenji/tools/driver.cpp:19: undefined reference to
`List<rec>::~List(void)'
/u/mrbenji/tools/driver.cpp:19: undefined reference to
`List<rec>::~List(void)'
*** Error code 1
make: Fatal error: Command failed for target `driver'
Benjamin S. Vera-Tudela
Computer Sciences Dept., UT Austin
http://www.cs.utexas.edu/users/mrbenji
---------------------------------------------------------------------------
Send administrative requests to [EMAIL PROTECTED]