Image

Imagedietolive wrote in Imagecpp

exporting class definitions

someone a few posts ago was having problems with the MSVC linker finding their class definitions, in a project there was a "main.cpp", a "myclass.cpp" and a "myclass.h".

the "myclass.h" file contained a class layout with exported class definitions (meaning Myclass::~MyClass() {} outside of the class decleration). the exported class definitions however (as i learned in highschool they should be) were in "myclass.cpp"

main.cpp and myclass.cpp had the standard #include "myclass.h" as well as iostream goodness and using namespace std;, but the damn VC linker WOULD NOT recognize the definition of the class' methods in another file, what is the point of such an abstraction if one of the major compilers out there will not recognize it? was the person below and i just thinking the wrong way? the class decleration goes in the .h, the method defintions go in the .cpp, right?

any thoughts? any links of interest related to this fun #include crap?

EDIT: THE ANSWER TO THIS POST CAN BE FOUND HERE..
http://www.devarticles.com/art/1/571/2