How did you install codeblocks?
In the sub folder of your installation there should be a folder called MinGW with a sub folder bin
go there and search for the libstdc++6.dll and copy it to your exe direcotry
you probably also need libgcc_s_seh-1.dll from the same folder
This is needed because your application is not statically linked and the open source compiler need some additional dlls (libstdc++6 is the standard library for c++). When you run it trough codeblocks, codeblocks adds the path MinGW/bin to the dll search paths automatically. If you run your executable by double klick this is not done, and your application can not find the dll