Mail Archives: djgpp/1997/04/25/07:29:56
/ William Heymann <heymann AT ucsu DOT Colorado DOT edu> wrote:
| I am currently working on using a template in my program to make a
| dynamic 1 and 2 dimensional array of any type. Whenever I try to compile
| the program the program will compile but, when it tries to link the
| program into an executable I get unrecognized fuction errors for every
| single function that I have that is part of the template.
| I tried originally having two files a cpp and an h file but, when I
| changed it to a template it didn't work. I looked at some examples in
| some C++ books that I have and they had everything in the header file so
| I put everything in my header file also. This still did not work. Even
| the books example did not work.
| Is there a specific way that I have to include files to make them
| templates or some syntax that I am missing. Included below is a small
| example that shows the code for the 1D dynamic array.
There are some trouble with gcc and templates.. (well to be honest,
not many compilers supports templates to 100% by the standard)
Check the info-docs for gcc, something like.. c++ extensions, template
instantiation.
/Andy
- Raw text -