C++ Headers Question

Associate
Joined
20 Aug 2007
Posts
539
Location
Exeter
Hi, I'm quite new to C++ programming, so please be nice. :p

Basically I'm having trouble compiling my program in Linux, having previously coded my program in Windows using Netbeans.

I have written 4 classes for my program, each having its own header file with the extension .hpp, in Windows when compiling I had to place these files inside my MinGW include folder.

Now, compiling in Linux, I was told that you can keep the .hpp files in the same folder as the .cpp files. However the error:

No such file or directory.

Is returned each time I try to compile, relating to the hpp file each time. Is there something that I'm doing wrong? Any help would be brilliant. :D

Thanks :)
 
How are you including the headers?

If the headers are in the include folder use #include <file.hpp>, if they're in the same folder as your cpp files use #include "file.hpp".
 
That's perfect! Thank you! :D

I had been using:

#include <file.hpp>

I needed to use "" like you said. :D

Now all I need to do is sort out ansi standards errors. :(
 
Not many, but apparently they're compiler bugs rather than problems with my code. So I'll just compile on another machine. :)
 
Back
Top Bottom