I installed visual studio 2012.i have windows 8.1.then i extract opencv 2.4.10 in c partition.
Created the visual C++ project->win32 Console application.
As I have x64 machine
build menu->Configuration manager->platform->x64
then i set below configuration in my vs project.
project->properties->configuration->all configuration
VC++Directories->Library Directories->
C:\opencv\build\x64\vc11\bin,C:\opencv\build\x64\vc11\lib
C/C++->Genaral->Additional Include Derectories->
C:\opencv\build\include,C:\opencv\build\include\opencv2,C:\opencv\build\include\opencv
change the
Configuration->Debug
Select Linker->Input->Additional Dependencies
opencv_core2410d.lib
opencv_highgui2410d.lib
opencv_imgproc2410d.lib
opencv_calib3d2410d.lib
opencv_contrib2410d.lib
opencv_features2d2410d.lib
opencv_flann2410d.lib
opencv_gpu2410d.lib
opencv_legacy2410d.lib
opencv_ml2410d.lib
opencv_nonfree2410d.lib
opencv_objdetect2410d.lib
opencv_photo2410d.lib
opencv_stitching2410d.lib
opencv_superres2410d.lib
opencv_ts2410d.lib
opencv_video2410d.lib
then
change Configuration->Release
select Linker->Input->Additional Dependencies
opencv_core2410.lib
opencv_highgui2410.lib
opencv_imgproc2410.lib
opencv_calib3d2410.lib
opencv_contrib2410.lib
opencv_features2d2410.lib
opencv_flann2410.lib
opencv_gpu2410.lib
opencv_legacy2410.lib
opencv_ml2410.lib
opencv_nonfree2410.lib
opencv_objdetect2410.lib
opencv_photo2410.lib
opencv_stitching2410.lib
opencv_superres2410.lib
opencv_ts2410.lib
opencv_video2410.lib
opencv_videostab2410.lib
then i created a class and wrote the code
#include "stdafx.h"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/core/core.hpp"
int main(){
//declare a new iplimage pointer
IplImage*myimage;
//load image
myimage = cvLoadImage("D:\\visual studio 2012\\katussa.jpg",1);
cvNamedWindow("Smile",1);
cvShowImage("Smile",myimage);
//wait for the key to close the window
cvWaitKey(0);
cvDestroyWindow("Smile");
cvReleaseImage(&myimage);
return 0;
}
when i run i got the error message The program can't start because opencv_core2410d.dll is missing.
You need to add OpenCV to your system path:
You need to add the directory C:\opencv\build\x86\vc10\bin to your system PATH. This directory contains OpenCV DLLs required for running your code.
Open Control Panel → System → Advanced system settings → Advanced Tab → Environment variables...
On the System Variables section, select Path (1), Edit (2), and type C:\opencv\build\x86\vc10\bin; (3), then click Ok.
ninja edit:
make sure you have follow all the steps on this tutorial
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With