0

I wrote a simple class:
c:\geometry\Point.h
c:\geometry\Point.cpp

I made a VS2005 project and added a Source File test.cpp which contains main(). In test.cpp, I #include "c:/geometry/Point.h"

When I build the project I get:

Unresolved external symbol "public: __thiscall Point::Point(double,double,double)" referenced in function _main.

However, if add Point.h to my Header Files and Point.cpp to my Source Files the error goes away. Why do I have to add these to the project? Can't I just use them by including them like I tried to?

Thanks,

David

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by daviddoria
0

Sorry for the silly question - I figured it out.

Turns out you only have to add the .ccp file to the project. When you #include "director/myclass.h", that declares the functions, but without the .cpp as part of the project, the function definitions are no where to be found!

David

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.