Multiple Definition (forced to use .cpp file) Urgent

Hey, my instructor gave us a header file, and an object file, we are to make a database using these, by inheritance, i have made it and it works fine if i put it all in one file, but since we are to use separate files. the problem arise is that .cpp file has driver, which drives the program to the desired location depending on the input (ex, make a new employee, etc), the driver consists of function such as make new,locate,print, these are implemented in the main.cpp file. now i must call the driver from the main.cpp file, since it has no header file the only way i think is to do it by doing #include"driver.cpp" in the main.cpp file, but that gives arise to problem, multiple definition. is there any way to get around this. My program is due in 3 hours, it i am frustrated of linking errors, can you please help me.
Last edited on
my instructor gave us a header file [snip] since it has no header file


Which is it?

You need a header file. Including the cpp won't work. Maybe you're supposed to write your own header file? But that seems very unlikely.
sorry, he gave us a header file for staff, so staff.h and staff.o, but for the driver only driver.cpp.
i figured it out, if i link the files all i have to do is declare a function prototype in main.cpp and it will call the function in the driver.cpp because of the linking in the make file.
Thank you for answering.
Topic archived. No new replies allowed.