This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Undefined reference to template function ...
- From: "Her, Il" <il dot her at hp dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Mon, 30 May 2011 00:22:19 +0000
- Subject: Undefined reference to template function ...
Hello, gcc-help.
I experienced "undefined reference to template function ." when I am compiling my program
with gcc 4.1.2.
Almost everyone says
that's because template functions weren't be implemented in the same unit where they are
prototyped. (I used .cpp file for implementation and .h file for declaration).
But, It works if I use gcc 3.4.6 compiler without any change of options.
Why is this happening?...
I am working with my customer, I can't make them understand the common rule for using template
because it works on gcc 3.4.6.
Can you explain this situation to me?
(Something like it is changed after 4.0 or you have any options to avoid this.)
Please, help me.
Thank you.
Her, Il
Technology Consulting
Technology Service Korea
TEL? : +82-2-2199-4475
Mobile : +82-10-4765-5597
il.her@hp.com