I recently just installed Code::Blocks on my new Windows Blue testing OS and noticed that when creating a new class, it stores the class in /scr/class.cpp and the header file in /include/class.h
Is this a c++ standard practice? Or is it something that Code::Blocks just does?
I know how to change it, but if it's standard coding practice, I would like to learn how to deal with this.
My problem is that by default the just gets a compile error saying that it is not found. I tried using #include "..\include\class.h"
but it does not work either. This part may be a little to "General Coding" ish, but my questions are justified I think.
i don't think that it exists a standard for this...
it's a "nice to do" rule for a ordered code path structure...
The problem with the "not found" error is annoying, that's true. The proper solution would be
#include "include/class.h"
because the base include directory is your project directory, so if you use "../include/class.h" you would go one directory to high.
or to add the include directory in Project->Build Options->search directories->compiler.
I think this should be done automatically (or at least optional with default on) from the "Add class" function... If I have time I will look into it...
greetings
Wow this is annoying... so I have to use #include "include/class.h"
in my main class, but in my other classes, I have to use #include "../include/class.h"
instead..
Well here's something that the Code::Blocks team could add to their to-do list, automatically fill in the directory with the correct path.. Hmm..
Does anyone else think that this is tedious to use different include code for classes in the main directory, in other directories, and having to change it to include the /include/ directory?
Thanks for the help though!
Also is it practice to store classes in the /src/ directory and headder files in the /include/ directory?