Codeblocks is not a compiler.... Codeblocks is a IDE.
You can use C::B with different compilers. Header files are part of the compiler. We don't know what compiler do you use, so we can't say if your compiler supports grapics.h.
If i remember correctly than graphics.h was part of the borland compiler and this is a really old compiler. I don't know if this is supported on newer windows (i even don't know if you are using windows)
If you have used the installer provided by the c::b site than you are using minwg gcc an this compiler doesn't support graphics.h
greetings