I have been compiling on linux using g++ in the terminal. I am not using any IDE's which I can if I want with netbeans, but I prefer not to. So my question is what other commands will I have to use if I want to #include a header file as a directive in my main.cpp? For example, suppose I create a main.cpp, then a example.h and example.cpp, I then #include "example.h" into main, trying to compile: g++ ~/Desktop/main.cpp -o ~/Desktop/main
will bring me errors displaying example.h does not exist.
I am still learning a lot with linux with a bunch of commands from making files, moving, opening, etc. I barely touch my mouse for anything, its really cool.
In you main.cpp, try changing your code from #include "example.h" and make it #include "DirLocation/example.h" .
I'm wrong right? Well, I'm also still starting using linux but I preferred understanding the entire environment first before digging deeper with commands later, though I'm starting with the basic ones... >:)