jalamaters.tan
jalamaters.tan

Reputation: 1

Compiler error : The program '[10216] ConsoleApplication1.exe' has exited with code -1073741701 (0xc000007b)

I'm trying the OpenCV library for my thesis. I already applied the steps given by http://opencv-srf.blogspot.com/2013/05/installing-configuring-opencv-with-vs.html My problem is that after building successfully I really think that the code should run properly. Please tell me the problem. Thanks :)

Code:

#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;
}

Build: 1>------ Build started: Project: ConsoleApplication1, Configuration: Debug Win32 ------ 1> ConsoleApplication1.cpp 1> ConsoleApplication1.vcxproj -> D:\Visual Studio\Projects\Project2\new\ConsoleApplication1\Debug\ConsoleApplication1.exe ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Debug: 'ConsoleApplication1.exe' (Win32): Loaded 'D:\Visual Studio\Projects\Project2\new\ConsoleApplication1\Debug\ConsoleApplication1.exe'. Symbols loaded. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Symbols loaded. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Symbols loaded. 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Symbols loaded. The program '[4136] ConsoleApplication1.exe' has exited with code -1073741701 (0xc000007b).

Upvotes: 0

Views: 1190

Answers (1)

David Heffernan
David Heffernan

Reputation: 613412

NTSTATUS code of 0xC000007B is STATUS_INVALID_IMAGE_FORMAT. Most likely your program is 32 bit and is trying to load 64 DLLs. Given that you mention OpenCV, I suspect that it's the OpenCV DLLs that are at the root of this.

Solutions:

  1. Make sure that your process finds 32 bit versions of the DLLs.
  2. Switch your project to target 64 bit.

Upvotes: 1

Related Questions