Template specialization produces multiple definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello, 
	After 3 days of reading and experiments I am stuck. 
 
	Suppose one t.h file declares a template class cT. Another tt.h includes t.h and contains cT template functions.  
	Function fspec() has general definition and a specialization for one type. 
	Now, I have TWO (!) files a.cpp and b.cpp, which both include tt.h and create objects of the same type of class cT. 
	All my attempts to compile such a project fail - fspec() multiple defined in a.o and b.o. 
 
	I tried my gcc3.2.2 (cross-compiled host=linux target=powerpc) with/without -frepo, with/without pragmas.... 
 
	Is there any way to link this without extracting fcpec() into separate file (or enveloping into #ifdef...)? 
 
Many thanks ahead for any help.	 
-- 
__________________________________________________________
Sign-up for your own personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux