Inheritance compile error
| bschmitt78 (3) | |||
| Hello, Being relatively new to OOP, inheritance is the topic at hand in my class presently. I wrote a 3 mini-programs that each inherit from a base class called "Employee." The compile error I am getting is as follows, and I am wondering if it's due to the Employee.h header file not being located in the same local directory as my derived class: fatal error C1083: Cannot open include file: 'Employee.h': No such file or directory 1>Generating Code... I used the #include "Employee.h" specifier in my derived classes, and I used the resolution operators correctly: public class CommissionEmployee : public Employee If you need to see all my program code, I can post it, but I don't think the code I have would help figure this out because the base class is not being recognized at all. I am using Visual C++ Express 2005, and I know that under tools-options there is a screen to configure your library, source, etc., directories but I think all those settings are fine. Thanks!! | |||
| firedraco (338) | |||
| You probably need to move Employee.h to the same directory as the other projects you are including it into. | |||
| Zhuge (56) | |||
| Yes. Putting quotes around the file you are including tells the compiler to look in the same directory for the file. | |||
| bschmitt78 (3) | |||
| OK, thanks. I will try moving the base class files to the derived class directory. | |||
| bschmitt78 (3) | |||
| You guys ROCK, thanks! This worked. | |||
This topic is archived - New replies not allowed.
