Thanks for your answers. Coming from visual studio and windows, I did not realise that extra dll's needed to be included (I wanted to get away from .net type stuff). I've followed Miguel's reply wrt static linking, and that worked nicely. As the software is for my own use, I guess the licensing requirements will not apply. I noticed, once I'd rebooted codeblocks and recompiled, the exe in the release directory was larger than before, and in fact larger than that in the debug directory, although previously it was smaller, and it now ruins fine, stand-alone. As it happens, the same program, compiled in visual studio, is considerably smaller, I guess it uses links directly into the windows system.
As an aside, I've tried on four occasions, different email addresses to register with cplusplus.com forum. I do not get the email, and no reply to their inquiry form. It seems it is broken, wrt new registrations, If either of you are members, any chance you could pm an admin or something. No problem registering here, on this code blocks forum.