Q: How do I troubleshoot an compiler problem?
A: I would start by turning on full Compiler logging.
This is done by selecting the "Full command line" option Under menu "Settings" -> "Compiler and Debugger" -> Global compiler settings -> [the compiler you use] -> "Other Setting" tab, "Compiler logging".
This option will make Code::Blocks output the exact commands it uses to compile your code.
Things to remember:
You should review all the commands and their options;
If you don't know what an option or a command does please read the documentation for the compiler/linker you're using;
Look for missing commands;
For every source file (.cpp; .c; .d; etc) in your project, you must have at least one command in the log. This command must produce an object file (file extension ".o" if using gcc/g++ and ".obj" if using Visual Studio);
Every object file should be linked in the final executable, if not there are undefined symbols errors;
Remember the file extension matters: *.c is compiled as C file, *.cpp is compiled as C++ file.