(/upfiles/14449968823861101.jpg) I'm building the Opencv stitching project by adding the available files by myself. The project gets build without any error but there is an error, when I run it without debugging. I'm using static libraries. The error is shown in this screenshot. When I debug this program then it throws the following message while going from line no. 97 to line no. 98.
Error when debugged:
"First-chance exception at 0x000007FEDB3CC7CB (opencv_world300.dll) in ConsoleApplication1.exe: 0xC0000005: Access violation reading location 0xFFFFFFFFFFFFFFFF.
If there is a handler for this exception, the program may be safely continued."
Thank-you in advance.
#include <iostream>
#include <opencv2\core\core.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\stitching.hpp>
#include <vector>
using namespace std;
using namespace cv;
vector<Mat> imgs;
int main(){
Mat img1 = imread("E:/seecs/thesis/ConsoleApplication1/ConsoleApplication1/panorama_image1.jpg");
if (img1.empty())
{
cout << "Can't read image '" << "'\n";
return -1;
}
imgs.push_back(img1);
Mat img2 = imread("E:/seecs/thesis/ConsoleApplication1/ConsoleApplication1/panorama_image2.jpg");
if (img2.empty())
{
cout << "Can't read image '" << "'\n";
return -1;
}
imgs.push_back(img2);
Mat panoramaImage;
Stitcher stitcher = Stitcher::createDefault();
Stitcher::Status stitcherStatus = stitcher.stitch(imgs,panoramaImage);
waitKey(0);
return 0;
}
The output of "cout << getBuildInformation() << endl;" is provided below:
videoio: Removing WinRT API headers by default
General configuration for OpenCV 3.0.0 =====================================
Version control: 3.0.0
Platform:
Host: Windows 6.1 AMD64
CMake: 2.8.11.2
CMake generator: Visual Studio 12 Win64
CMake build tool: C:/PROGRA~2/MSBuild/12.0/Bin/MSBuild.exe
MSVC: 1800
C/C++:
Built as dynamic libs?: YES
C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio12.0/VC/bin/x86_amd64/cl.exe (ver 18.0.21005.1)
C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /wd4251 /wd4324 /MP4 /MD /O2 /Ob2 /D NDEBUG /Zi
C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /EHa /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /wd4251 /wd4324 /MP4 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
C Compiler: C:/Program Files (x86)/Microsoft Visual Studio12.0/VC/bin/x86_amd64/cl.exe
C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi/MP4 /MD /O2 /Ob2 /D NDEBUG /Zi
C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi/MP4 /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
Linker flags (Release): /machine:x64 /INCREMENTAL:NO /debug
Linker flags (Debug): /machine:x64 /debug /INCREMENTAL
Precompiled headers: YES
Extra dependencies:
3rdparty dependencies: ippicv
OpenCV modules:
To be built: hal core flann imgproc ml photo video imgcodecs
shape videoio highgui objdetect superres ts features2d calib3d stitching videos
tab world
Disabled: -
Disabled by dependency: -
Unavailable: cudaarithm cudabgsegm cudacodec cudafeatures2d
cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarp
ing cudev java python2 viz
Windows RT support: NO
GUI:
QT: NO
Win32 UI: YES
OpenGL support: NO
VTK support: NO
Media I/O:
ZLib: build (ver 1.2.8)
JPEG: build (ver 90)
WEBP: build (ver 0.3.1)
PNG: build (ver 1.5.12)
TIFF: build (ver 42 - 4.0.2)
JPEG 2000: build (ver 1.900.1)
OpenEXR: build (ver 1.7.1)
GDAL: NO
Video I/O:
Video for Windows: YES
DC1394 1.x: NO
DC1394 2.x: NO
FFMPEG: YES (prebuilt binaries)
codec: YES (ver 55.18.102)
format: YES (ver 55.12.100)
util: YES (ver 52.38.100)
swscale: YES (ver 2.3.100)
resample: NO
gentoo-style: YES
OpenNI: NO
OpenNI PrimeSensor Modules: NO
OpenNI2: NO
PvAPI: NO
GigEVisionSDK: NO
DirectShow: YES
Media Foundation: NO
XIMEA: NO
Intel PerC: NO
Other third-party libraries:
Use IPP: 8.2.1 [8.2.1]
at: C:/builds/master_PackSlave-win64-vc12-shared/op
encv/3rdparty/ippicv/unpack/ippicv_win
Use IPP Async: NO
Use Eigen: NO
Use TBB: NO
Use OpenMP: NO
Use GCD NO
Use Concurrency YES
Use C=: NO
Use pthreads for parallel for:
NO
Use Cuda: NO
Use OpenCL: YES
OpenCL:
Version: dynamic
Include path: C:/builds/master_PackSlave-win64-vc12-shared/opencv/3rdparty/include/opencl/1.2 C:/Program Files (x86)/AMD/clAmdFft/include C:/
Program Files (x86)/AMD/clAmdBlas/include
Use AMDFFT: YES
Use AMDBLAS: YES
Python 2:
Interpreter: c:/python27-x64/python.exe (ver 2.7.5)
Python 3:
Interpreter: NO
Python (for build): c:/python27-x64/python.exe
Java:
ant: C:/Program Files (x86)/apache-ant/bin/ant.bat (ver 1.9.2)
JNI: C:/Program Files/Java/jdk1.6.0_45/include C:/Program Files/Java/jdk1.6.0_45/include/win32 C:/Program Files/Java/jdk1.6.0_45/include
Java wrappers: NO
Java tests: NO
Matlab:
mex: NO
Tests and samples:
Tests: NO
Performance tests: NO
C/C++ Examples: NO
Install path: C:/builds/master_PackSlave-win64-vc12-shared/build/install
cvconfig.h is in: C:/builds/master_PackSlave-win64-vc12-shared/build/opencv_build
Press any key to continue . . .
*CMAKE CMAKE ouptut window with the following errors:
When Visual studio 12 2013 Win64: *Win64:
The C compiler identification is MSVC 18.0.40629.0
The CXX compiler identification is MSVC 18.0.40629.0
Check for working C compiler using: Visual Studio 12 2013 Win64
Check for working C compiler using: Visual Studio 12 2013 Win64 -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/x86_amd64/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/opencv_3.0/opencv/sources/otherrrr/CMakeFiles/CMakeTmp
Run Build Command:"C:/Program Files (x86)/MSBuild/12.0/bin/MSBuild.exe"
"cmTC_79e30.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=12.0"
Microsoft (R) Build Engine version 12.0.40629.0
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/17/2015 3:56:06 PM.
Project
"C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj"
on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTC_79e30.dir\Debug\".
Creating directory "C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\Debug\".
Creating directory "cmTC_79e30.dir\Debug\cmTC_79e30.tlog\".
InitializeBuildStatus:
Creating "cmTC_79e30.dir\Debug\cmTC_79e30.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /IC:\opencv_2.4.9\build\include /IC:\opencv_2.4.9\build\include\opencv2 /IC:\opencv_2.4.9\build\include\opencv /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _UNICODE /D UNICODE /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_79e30.dir\Debug\\" /Fd"cmTC_79e30.dir\Debug\vc120.pdb" /Gd /TC /errorReport:queue C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\testCCompiler.c
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.40629 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
cl /c /IC:\opencv_2.4.9\build\include /IC:\opencv_2.4.9\build\include\opencv2 /IC:\opencv_2.4.9\build\include\opencv /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _UNICODE /D UNICODE /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_79e30.dir\Debug\\" /Fd"cmTC_79e30.dir\Debug\vc120.pdb" /Gd /TC /errorReport:queue C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\testCCompiler.c
testCCompiler.c
Link:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\Debug\cmTC_79e30.exe" /INCREMENTAL /NOLOGO /LIBPATH:C:\opencv_2.4.9\build\x64\vc12\lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /NODEFAULTLIB /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"C:/opencv_3.0/opencv/sources/otherrrr/CMakeFiles/CMakeTmp/Debug/cmTC_79e30.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/opencv_3.0/opencv/sources/otherrrr/CMakeFiles/CMakeTmp/Debug/cmTC_79e30.lib" /MACHINE:X64 /machine:x64 /debug cmTC_79e30.dir\Debug\testCCompiler.obj
testCCompiler.obj : error LNK2001: unresolved external symbol _RTC_InitBase
[C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
testCCompiler.obj : error LNK2001: unresolved external symbol _RTC_Shutdown
[C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
LINK : error LNK2001: unresolved external symbol mainCRTStartup
[C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\Debug\cmTC_79e30.exe
: fatal error LNK1120: 3 unresolved externals
[C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
Done Building Project
"C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj"
(default targets) -- FAILED.
Build FAILED.
"C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj"
(default target) (1) ->
(Link target) ->
testCCompiler.obj : error LNK2001: unresolved external symbol _RTC_InitBase [C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
testCCompiler.obj : error LNK2001: unresolved external symbol _RTC_Shutdown [C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
LINK : error LNK2001: unresolved external symbol mainCRTStartup [C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\Debug\cmTC_79e30.exe : fatal error LNK1120: 3 unresolved externals [C:\opencv_3.0\opencv\sources\otherrrr\CMakeFiles\CMakeTmp\cmTC_79e30.vcxproj]
0 Warning(s)
4 Error(s)
Time Elapsed 00:00:03.21
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:3 (PROJECT)
Configuring incomplete, errors occurred!
See also "C:/opencv_3.0/opencv/sources/otherrrr/CMakeFiles/CMakeOutput.log".
See also "C:/opencv_3.0/opencv/sources/otherrrr/CMakeFiles/CMakeError.log".
Visual Studio 12 2013:
The C compiler identification is MSVC 18.0.40629.0
The CXX compiler identification is MSVC 18.0.40629.0
Check for working C compiler using: Visual Studio 12 2013
Check for working C compiler using: Visual Studio 12 2013 -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working CXX compiler using: Visual Studio 12 2013
Check for working CXX compiler using: Visual Studio 12 2013 -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "OpenCV", but
CMake did not find one.
Could not find a package configuration file provided by "OpenCV" with any
of the following names:
OpenCVConfig.cmake
opencv-config.cmake
Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
"OpenCV_DIR" to a directory containing one of the above files. If "OpenCV"
provides a separate development package or SDK, be sure it has been
installed.
Configuring incomplete, errors occurred!
See also "C:/opencv_3.0/opencv/sources/otherrrr/CMakeFiles/CMakeOutput.log".