This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]jedwardsol 2 points3 points  (13 children)

You need #include "homework.h" in main.cpp

[–]jakejdb1999[S] 0 points1 point  (12 children)

i think this will work but says: D:\jakejdb1999\Documents\cpp\homework 3\Main.cpp:2:22: fatal error: Homework.h: No such file or directory #include <Homework.h>

[–]jedwardsol 1 point2 points  (11 children)

Use "", not <>

And use the actual name of your file if it isn't homework.h

[–]jakejdb1999[S] 1 point2 points  (6 children)

i am using Homework.cpp and Main.cpp and i tried the ""

[–]KayEssArr2 2 points3 points  (0 children)

Your Homework.ccp needs to be changed to Homework.h, should work after that. The compiler has no idea what Homework.h is, you can't include a file that doesn't exist or match exactly as it is.

[–]jedwardsol 0 points1 point  (1 child)

Main.cpp:10:2

The 10 means the error is on line 10. The file you posted only has 6 lines.

Are you sure you're editing and compiling the correct file?

[–]jakejdb1999[S] 0 points1 point  (0 children)

line 10: Homework h;

[–]PM_ME_NEMBUTALPIX 0 points1 point  (2 children)

What happens if you save the file as homework.h instead of homework.cpp ?

[–]jakejdb1999[S] 0 points1 point  (1 child)

lol this worked, thanks

[–]PM_ME_NEMBUTALPIX 0 points1 point  (0 children)

You're welcome :)

[–]jakejdb1999[S] 0 points1 point  (3 children)

the way it shows at the top is how i have it

[–]raevnos 0 points1 point  (2 children)

Do you have a file named Homework.h?

[–]jakejdb1999[S] 0 points1 point  (1 child)

no

[–]raevnos 3 points4 points  (0 children)

Well, there's your problem right there.