Ok, but generally I do all my own files (no project) then just build. Is that not a good way of doing it?
I just feel somehow I am not linking properly, and getting some errors that take some time to figure out - but I'm thinking some those errors are all because of poor linking.
I am thinking : I should do like I have been - - #include Header File in the cpp
and in main #include all my .cpp files
> and in main #include all my .cpp files
> I guess that is what you were saying above huh?
No that is not what I'm saying at all.
Including one .cpp inside another .cpp is the wrong way to do it.
For small projects, this works fine. g++ base.cpp d1.cpp d2.cpp main.cpp
For larger projects, you use make (or whatever your IDE calls a project).
Regardless, the automation usually ends up doing. g++ -c base.cpp
g++ -c d1.cpp
g++ -c d2.cpp
g++ -c main.cpp
g++ base.o d1.o d2.o main.o
The point of this being that tools like make minimise the amount of recompilation.
If you've got 100's or 1000's of source files, you don't want to be recompiling everything for every small edit you make.