c++/8434: Template Inclusion - keyword 'export' not implemented

mjmaterna60193@yahoo.com mjmaterna60193@yahoo.com
Sat Nov 2 20:56:00 GMT 2002

>Number:         8434
>Category:       c++
>Synopsis:       Template Inclusion - keyword 'export' not implemented
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 02 20:56:00 PST 2002
>Originator:     Mark J. Materna
>Release:        2.95.3-216
Because the keyword export is not yet implemented it seems that I can not have separatley complied template definitions.  Without the key word "export" when a templated class is declared in a .h and defined in a .cpp, when linking the templated class does not seem to be accessable to other translation units. This is expected according to Stroustrup. Is there another way around this?
(Putting the definition in the include is really not ideal because the templated class will be widely used.) I do require this functionality.  

See attached file for an example. The complie command is:
g++ main.cpp matrix.cpp -o matrix
g++ main.cpp matrix.cpp -o matrix


More information about the Gcc-bugs mailing list