In order to do that you need to have a library (plus header files) for your compiler, then setup Code::Blocks to find it and link against it. graphics.h is a header that was available in Turbo C++ from Borland, but it was a 16 bit DOS thing. The only bundle we provide is with the MinGW compiler, but it does not come with such file. Have in mind we do not support MinGW either. We only offer it for convenience.
I cannot help you further as it is a third party thing, and we only support Code::Blocks here (which is not a compiler). You better try your luck with Google, or perhaps Stack Overflow.