Problem with reading an image file (detailed description included). Pls help! D:
-
Sunday, September 16, 2012 7:36 AM
code in main.cpp:
#include"StdAfx.h"
#include <cv.h>
#include <highgui.h>
int main(int argc, char* argv[]) {
IplImage* img = cvLoadImage( "testimg.jpg" );
cvNamedWindow( "MyJPG", CV_WINDOW_AUTOSIZE );
cvShowImage("MyJPG", img);
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "MyJPG" );
return 0;
}Actions I have taken after typing in this code:
1. Application settings:
- Console application
- Empty project
2. Project Properties (ALT+F7):
2.1 On the Configuration box, select All Configurations
2.2 Open Configuration Properties > C/C++ > General, and edit the field Additional Include Directories
to add these 3 paths (for the headers):
C:\OpenCV2.3\build\include\opencv
C:\OpenCV2.3\build\include\opencv2
C:\OpenCV2.3\build\include
3. Add the path of the libraries on Configuration Properties > Linker > General, and on the
Additional Library Directories field, add this:
C:\OpenCV2.3\build\x86\vc9\lib
4. Go to Configuration Properties > Linker > Input
Add the libraries
opencv_core230.lib
opencv_highgui230.lib
5. Modify the PATH environment variable of your system to
add the location of OpenCV's DLLs. Add this to end of PATH:
C:\OpenCV2.3\build\x86\vc9\bin
Tried debugging by including more files via add existing items and added the header files of those that i tried to use #include for.
errors obtained:
- Moved by Jesse JiangMicrosoft Contingent Staff Monday, September 17, 2012 7:28 AM (From:Visual C++ Express Edition)
All Replies
-
Monday, September 17, 2012 7:30 AM
Hello,
Thanks for your post.
According to your description, this issue is relative to a third-party product(OpenCV). Please go to the forum for the third-party product to ask for help. This thread will be moved to Off-topic.
Your understanding will be appreciated.
Regards,
Damon Zheng [MSFT]
MSDN Community Support | Feedback to us

