The exact error message is the key to solve the issue. Just try to run it again and search for the error message in Google. Chances are you will find the answer quite quickly.
Code::Blocks does not provide a mechanism to create installers from the project. However, there are a couple of programs that can be used to create installers. You could try NSIS for example.
Chances are your program is missing a dependency. If that is the case, the error message should tell you the name of the missing file. You will need that file in order to run the program somewhere else. To get a complete tree of all dependencies, you can use a software like Dependency Walker (it also lists system files which should already exist in all PCs).