Template Implementaion in a DLL problem linking problem... 
Author Message
 Template Implementaion in a DLL problem linking problem...

Hi all,
    I want to hide the implementation details of my class templates in a
.cpp implementation file (IE: define), and only have the declaration of the
template in a .h file.  If i link everything statically, i don't have any
problems, but if the .cpp resides in a DLL i can't get it to link  My
declspec stuff is all fine for striaght non-template class function
definitions, but the templates have a problem.  Has anyone come across the
problem of putting template definitions in a .cpp file?  I really hate
having all my template code available in a .h.  It defeats the purpose of
encapsulation, if any Tom,{*filter*} and Harry can modifiy or rip my code?

Thanks,
Shane

--
Shane Stevens
Lead Programmer
Blue Tongue Software
www.bluetongue.com



Tue, 19 Aug 2003 10:05:49 GMT  
 Template Implementaion in a DLL problem linking problem...

Quote:
> Hi all,
>     I want to hide the implementation details of my class templates in a
> .cpp implementation file (IE: define), and only have the declaration of
the
> template in a .h file.  If i link everything statically, i don't have any
> problems, but if the .cpp resides in a DLL i can't get it to link  My
> declspec stuff is all fine for striaght non-template class function
> definitions, but the templates have a problem.  Has anyone come across the
> problem of putting template definitions in a .cpp file?  I really hate
> having all my template code available in a .h.  It defeats the purpose of
> encapsulation, if any Tom,{*filter*} and Harry can modifiy or rip my code?

VC++ does not support the separate compilation of templates.

NeilB



Tue, 19 Aug 2003 10:18:04 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. linking problem with templates!!!

2. template class link problem

3. template method external link problem

4. Template inner-class compile/link problem

5. Problem linking with template classes

6. VC C++ 5.0 and template link problem

7. Linking Problem Using Templates

8. Help) Link Problems when use Function Template

9. Implementaion of MAPI- Function results link errors

10. template & dll problem

11. Problems with STL and template classes in DLL's

12. problems with dll:s and templates

 

 
Powered by phpBB® Forum Software