Sign in to follow this  
twoaterisn

header files etc.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this