Do you link it with the OpenCV lib files?
I don’t know how to do this in codeblocks, but in the build options you should have a list of linked libraries, where you should have the opencv_[something].lib (or -lopencv_[something]) files.
Note that in order to run the app, it should have access to the OpenCV DLL files.