• Advertisement
Sign in to follow this  

header files etc.

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement