Install a virtual machine, for example VirtualBox, install operating systems, install CodeBlocks, etc., compile.
Note that a multi-platform IDE or compiler means that the same IDE or compiler exists on more platforms. It does not mean that the compiler can compile for "foreign" operating systems and if it can, then count on serious restrictions. For example, linker: needed libraries or DLLs are nowhere in sight. Even if it can, you cannot run the "foreign" app so that you do not know what you have compiled or linked.