I have installed Microsoft Visual C++ Express Edition, Version 9.0.30729.1 SP. The command line compiler that comes with it is at Version 15.00.30729.01 for 80x86. I have installed OpenCV 20.0a.
I want to compile the following program:
#include <cv.h>
#include <cxcore.h>
#include <highgui.h>
int _tmain(int argc, _TCHAR* argv[])
{
IplImage *img = cvLoadImage("funny-pictures-cat-goes-pew.jpg");
cvNamedWindow("Image:",1);
cvShowImage("Image:",img);
cvWaitKey();
cvDestroyWindow("Image:");
cvReleaseImage(&img);
return 0;
}
The thing is, I do NOT want to use the "visual" aspect of Visual C++, I want to use the command line compiler which is "cl.exe".
When I try to compile this program, I get the error:
C:\visualcpp>cl OpenCV_Helloworld.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved.
OpenCV_Helloworld.cpp
OpenCV_Helloworld.cpp(6) : fatal error C1083: Cannot open include file: 'cv.h': No such file or directory
So I tried to specifiy with /I like this
C:\visualcpp>cl /I "C:\OpenCV2.0\src\cv" OpenCV_Helloworld.cpp
And variations thereof, in the hope that /I would somehow tell cl.exe where cv.h is, but I get the same error.
As a side note, I don't know if that's related but I noticed that there is no file "cv.h" in "C:\OpenCV2.0\src\", but rather a file called "_cv.h"! So I changed the header accordingly, but still.
I think I'm able to program in C++ somewhat but I don't understand how to specify header / linker file locations, especially with cl.exe as I have only used gcc before and I don't think I know what I'm doing right now. Please help me to compile this! I want to get started in OpenCV.