|
From: Al S. <al....@sc...> - 2003-06-20 14:11:07
|
Hi,
I am having a problem with templated code being exported from a dll.
This is an example as the real code is too complex to produce here :)
Header.h
class myclass
{
};
template <class T> class tclass
{
static T record;
}
/*****/
Instant.cpp
#include "Header.h"
myclass tclass<myclass>::record; // instantiate the static record
/* more myclass stuff */
/********/
The above is compiled into a dll using g++ -shared -export-all
When a program is compiled against the above dll (linking directly to
the dll) the program Appears to get its own copy of myclass
tclass<myclass>::record wich appears to override the one in the dll.
Does this ring any bells with anyone?
I'll try to come up with a real test case in the meantime.
Regards
Al Slater
Senior Developer
Stanton Consultancy
|