TURN ON Full Compiler Logging!
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
Then, post what the build log is currently and then below that say what you think is wrong.
Note: The reason for Caps and exclamation point is I have tried to help 5 people know who all failed to turn on "Full Compiler Logging" If you fail I will just give up helping newbies.
Edit 1: Code::Blocks is a two pass system; you will never get exactly what you want. You might wish to use a custom MakeFile; but, since that is hard for a newbie not sure what is best.
gcc main.c file1.c file2.c -o TEST
Below is likely to be linking command
gcc main.o file1.o file2.0 -o TEST
Tim S.