I've just started using Code::Blocks (on Windows 7) and I'm very impressed with it. I have managed to build a reasonably complex gfortran DLL project, and an executable that links to it. In the process I encountered a couple of issues with modules, and I'm not sure if there is a way to deal with them in CB. The first thing I noticed, after loading the 10 or so source files, was that the build command produced errors because it was trying to compile code before the modules used by the code had been compiled. I manually compiled each file, in the required order, to get the whole project installed. So my first question is this: is there a way to control the order in which files are compiled? Later I discovered another couple of things about how CB handles modules. Modules are not deleted when a "clean" is invoked. In a way this is fortunate, because if they were removed I'd need to do the manual recompilation sequence after a clean, but it does create a potential problem when "stale" modules are left in the directory. This created a puzzle for me when I changed the gfortran version, then couldn't get the executable to link to the DLL (after cleaning and rebuilding). I eventually realized that the .mod files I was using had been built by the previous compiler version, and were in some way incompatible (I was getting "multiple definition" errors on linking).
Can I force CB to remove .mod files on a clean?