First error that you made is the following : installing openCV version 2.3.1 instead of version 2.4.5 or you followed a guide describing 2.3.1 and did download 2.4.5.
Some basics that you should check:
- At the linker include libraries, be sure that the name of the dll is exactly like it should be. For example, the core library should be : opencv_core245d.lib in debug mode and opencv_core245.lib in release mode.
- Be sure that you added the dll folder into your path variable of your system. In your case this should be something like: D:\opencv\build\x64\vc10\bin\ or D:\OpenCV2.4\build\x86\vc10\bin\ depending on which operating system you use.
Then head back for more help if this doesn't work.