header files etc.

Started by
2 comments, last by Kylotan 15 years, 6 months ago
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
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?
scottrick49
It Doesn't Work because you have a problem. We cannot guess that problem, because you didn't give us any useful information.
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?

This topic is closed to new replies.

Advertisement