我正在爲我的論文嘗試OpenCV庫。我已經應用了http://opencv-srf.blogspot.com/2013/05/installing-configuring-opencv-with-vs.html給出的步驟我的問題是,成功構建後,我真的認爲代碼應該正常運行。請告訴我這個問題。謝謝:)編譯器錯誤:程序'[10216] ConsoleApplication1.exe'已退出,代碼爲-1073741701(0xc000007b)
代碼:
#include "stdafx.h"
#include "opencv2/highgui/highgui.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main(int argc, const char** argv)
{
Mat img(500, 1000, CV_8UC3, Scalar(0,0, 100)); //create an image (3 channels, 8 bit image depth, 500 high, 1000 wide, (0, 0, 100) assigned for Blue, Green and Red plane respectively.)
if (img.empty()) //check whether the image is loaded or not
{
cout << "Error : Image cannot be loaded..!!" << endl;
//system("pause"); //wait for a key press
return -1;
}
namedWindow("MyWindow", CV_WINDOW_AUTOSIZE); //create a window with the name "MyWindow"
imshow("MyWindow", img); //display the image which is stored in the 'img' in the "MyWindow" window
waitKey(0); //wait infinite time for a keypress
destroyWindow("MyWindow"); //destroy the window with the name, "MyWindow"
return 0;
}
體形: 1> ------構建開始:項目:ConsoleApplication1,配置:調試的Win32 ------ 1> ConsoleApplication1.cpp 1> ConsoleApplication1.vcxproj - > D:\ Visual Studio \ Projects \ Project2 \ new \ ConsoleApplication1 \ Debug \ ConsoleApplication1.exe ==========構建:1成功,0失敗,0最多日期,0跳過==========
調試: 'ConsoleApplication1.exe'(Win32):Lo 'D:\ Visual Studio \ Projects \ Project2 \ new \ ConsoleApplication1 \ Debug \ ConsoleApplication1.exe'。符號加載。 'ConsoleApplication1.exe'(Win32):加載'C:\ Windows \ SysWOW64 \ ntdll.dll'。符號加載。 'ConsoleApplication1.exe'(Win32):加載'C:\ Windows \ SysWOW64 \ kernel32.dll'。符號加載。 'ConsoleApplication1.exe'(Win32):加載'C:\ Windows \ SysWOW64 \ KernelBase.dll'。符號加載。 程序'[4136] ConsoleApplication1.exe'已退出,代碼爲-1073741701(0xc000007b)。
鏈接的文章強烈建議您通過討論如何設置x86版本的OpenCV來獲得此權利。無論如何,看起來你有這個錯誤。 –