C++ OpenCV配置VS 2015
我找遍了所有我能找到的地方。我有Visual Studio 2015和OpenCV 3.0.0。我以前没有使用过OpenCV,尽管我已经查阅了关于这个问题的教程。我找不到适用于3.0.0的任何应用程序。我一直在尝试运行测试应用程序:C++ OpenCV配置VS 2015,c++,opencv,visual-studio-2015,C++,Opencv,Visual Studio 2015,我找遍了所有我能找到的地方。我有Visual Studio 2015和OpenCV 3.0.0。我以前没有使用过OpenCV,尽管我已经查阅了关于这个问题的教程。我找不到适用于3.0.0的任何应用程序。我一直在尝试运行测试应用程序: #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <iostream> using namespace cv; us
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
if( argc != 2)
{
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
}
Mat image;
image = imread(argv[1], IMREAD_COLOR); // Read the file
if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
namedWindow( "Display window", WINDOW_AUTOSIZE ); .
imshow( "Display window", image ); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}
进入链接器的附加库目录。
然而。我仍然无法构建代码(取自OpenCV文档)
由于以下错误:
Error C2146 syntax error: missing ';' before identifier 'image' 31
此错误仅在尝试生成时出现。Intellisense没有抱怨,接受Mat作为一个类。
如果有帮助的话,我还可以提供我的附加依赖项和所有其他更改的设置 您需要使用visual studio 2015编译器重建opencv。您使用的是vs2013预构建的版本。我可以使用CMake吗?是的。。网上有很多教程。谢谢。我将重新编译Visual Studio 2015的库。我知道我错过了什么。
Error C2146 syntax error: missing ';' before identifier 'image' 31