I solved it. instead of adding the header directories under the compiler's search directories. I added the following line:
`pkg-config --libs --cflags gtkmm-3.0`
to other options under both compiler and linker in codeblocks. that solved all conflicts and allowed me to run my test program finally.