I would like to write simple program to capture images with Allied Vision Technologies Camera using QT Creator in C++. The problem is I have some errors which I don't understand. I created a simple QT console application. I added external libraries to the project. (Right click on project -> add libraries, external libraries, AVTVimba.lib, and include folder with *.h files).
My .pro file:
QT += core
QT -= gui
TARGET = AVT3
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Lib/Win64/ -lVimbaCPP
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Lib/Win64/ -lVimbaCPPd
INCLUDEPATH += $$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Include
DEPENDPATH += $$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Include
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Lib/Win64/libVimbaCPP.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Lib/Win64/libVimbaCPPd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Lib/Win64/VimbaCPP.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaCPP/Lib/Win64/VimbaCPPd.lib
INCLUDEPATH +="D:\Programy\AVTVimba_1.3"
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Programy/AVTVimba_1.3/VimbaC/Lib/Win64/ -lVimbaC
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Programy/AVTVimba_1.3/VimbaC/Lib/Win64/ -lVimbaCd
INCLUDEPATH += $$PWD/../../Programy/AVTVimba_1.3/VimbaC/Include
DEPENDPATH += $$PWD/../../Programy/AVTVimba_1.3/VimbaC/Include
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaC/Lib/Win64/libVimbaC.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaC/Lib/Win64/libVimbaCd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaC/Lib/Win64/VimbaC.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Programy/AVTVimba_1.3/VimbaC/Lib/Win64/VimbaCd.lib
Everything seems to be fine, I can include header file VimbaCPP.h to my project and use AVT::VmbAPI namespace and don't have any compile errors. In order to test if everything works fine I tried to copy listing from AVT CPP Manual.
#include <QCoreApplication>
#include "VimbaCPP.h"
#include <iostream>
using namespace std;
using namespace AVT::VmbAPI;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
cout<<"123"<<endl;
CameraPtrVector cameras;
// VimbaSystem &system = VimbaSystem::GetInstance();
return a.exec();
}
The code above compiles and runs without any problems. CameraPtrVector is a part of AVT::VmbAPI namespace so I assume that libraries are linked correctly. Now when I uncomment the next line: "VimbaSystem &system..." my program doesn't work and is executed with code -1073741510. I can't find the source of this problem. I would really appreciate some help.