• ### Popular Now

• 11
• 9
• 10
• 9
• 11

This topic is 3478 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I am working on my first truly functional program which will allow for a user to draw a chemical structure in a window. I have implemented the class which describes the molecule (chemical structure) and now i want to seperate this from the main program which uses one instance of this class. How do i do this? I've putting all forward declarations in "molecule.h" and added #include "molecule.h" to my molecule.cpp file. Now i still need to add something to the main.cpp file to allow it to use the full "molecule" functionality, but i can't find out what. Adding #include "molecule.h" or #include "molecule.cpp" doesn't seem to work... thanks in advance, TH

##### Share on other sites
main.cpp should just need to contain:

#include "molecule.h"

Don't include the .cpp file, that isn't what you want to do. Its hard to say what is wrong without knowing what the error you are recieving is. Could you describe the error better, or post some code for us to look at?

##### Share on other sites
It Doesn't Work because you have a problem. We cannot guess that problem, because you didn't give us any useful information.

##### Share on other sites
This question would be better if it stated 3 things:

1) What exactly are you doing?
2) What exactly do you expect to happen?
3) What exactly do you see instead of that?