Thanks, I did what you say, but it does not work.
This is what I get: undefined reference to all the functions that are
used in the main source file.
Perhaps I am wrong in respect to the process of building the a file and
I am being idiot. There is some site where I can see if there is
something special for write static libraries? In the Bruce Eckel's
"Thinking in C++" it is suggested that simply do what I do, take the .o
files, give them to librarian and passing it to the lib dir and the h to
the include dir, just what I do.
d:\devpro\newf\containtry.o: In function `main':
//d/devpro/newf/containtry.cpp:16: undefined reference to
`container<int>::container(void)'
//d/devpro/newf/containtry.cpp:16: undefined reference to
`container<int>::~container(void)'
//d/devpro/newf/containtry.cpp:19: undefined reference to
`container<int>::addcontainer(int)'
//d/devpro/newf/containtry.cpp:44: undefined reference to
`container<int>::operator[](int)'
//d/devpro/newf/containtry.cpp:53: undefined reference to
`container<int>::killcontainer(void)'
//d/devpro/newf/containtry.cpp:56: undefined reference to
`container<int>::~container(void)'
If I make #include <container.cpp> then it works perfectly.
|