I have codeblocks installed on an HD, the compiler works fine. The reason its on an HD is because my school doesn't like people installing things onto the computers...
main.cpp works fine. If I coded everything in this I wouldn't run into any problems. The only problem is, if I add a class to the project I get several errors.
I touched the classes at all, they compile fine on my computer at home. Is it because the project is not saved in a proper directory/folder? I have a folder for the project inside the codeblocks folder on the HD, so it should be able to find the theclass.h and theclass.cpp files.
If main.cpp also didn't work, it would make more sense. But why is it that the new class won't work?
It looks like theclass.h
is in the include
directory, a sibling directory of src
. You should either get both files in the same directory, or use #include "../theclass.h"
if you absolutely must keep the files where they are.