N
Nishith Prabhakar
Hi,
I have a class which inherits from a template (vector). This class is
defined in the header file as below.
Output.h
class _DLL_RESPONSE_SERVER Output : public vector<SingleOutput>
{
public:
Output();
const string& getActualText() const {return m_actualText;}
void insert(const SingleOutput& so);
}
The "Output::Insert" is defined in a CPP file separately.
Output.cpp
void ResponseServer::Output::insert(const ResponseServer::SingleOutput&
so)
{
// doSomething
}
That code gets compiled into a "LIB" and a "DLL".
When i try to use the Output.h in another project and try to link to
the LIB, i get an external symbols unresolved error for the size()
method.
Is this because templates will have some kind of inlining ?
What am i missing here ? Wont the "size()" method defined in the
template vector
1) either get compiled into the Output.LIB
2) OR will it not be picked up in the target consumer project where i
have access to the Output.h and to the Vector LIB/H as well. How do i
need to setup the consumer project to use the Output.LIB and at the
same time have definitions even for the superclass template?
Thanks
Nishith
I have a class which inherits from a template (vector). This class is
defined in the header file as below.
Output.h
class _DLL_RESPONSE_SERVER Output : public vector<SingleOutput>
{
public:
Output();
const string& getActualText() const {return m_actualText;}
void insert(const SingleOutput& so);
}
The "Output::Insert" is defined in a CPP file separately.
Output.cpp
void ResponseServer::Output::insert(const ResponseServer::SingleOutput&
so)
{
// doSomething
}
That code gets compiled into a "LIB" and a "DLL".
When i try to use the Output.h in another project and try to link to
the LIB, i get an external symbols unresolved error for the size()
method.
Is this because templates will have some kind of inlining ?
What am i missing here ? Wont the "size()" method defined in the
template vector
1) either get compiled into the Output.LIB
2) OR will it not be picked up in the target consumer project where i
have access to the Output.h and to the Vector LIB/H as well. How do i
need to setup the consumer project to use the Output.LIB and at the
same time have definitions even for the superclass template?
Thanks
Nishith