Re: Amusing


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by Jamie Eckman on March 29, 2001 at 14:56:59:

In Reply to: Amusing posted by Brent on March 29, 2001 at 14:37:54:

: Arrayt.h
: "
: template class ArrayT
: {
: private:
: int size;
: public:
: ArrayT();
: };"

: -> arrayt.cpp
: "#include "arrayt.h"

: template ArrayT::ArrayT()
: {
: }"

:
: ok given those as an example of the very most basic possible template definition,
: creating an instance of this
: ArrayT somearray;

: causes a linker error.

: Am i missing something obvious?>


At the END of arrayt.h you need to include arrayt.cpp. You do NOT need to include arrayt.h in arraty.cpp. Or you could just put everything on the header file.

-Jamie


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]