Hello, I urgently need your help!
I'm trying to involve an AVT Pike camera into my Qt project. When I add the libraries to my .pro-file and instantiate a CFGCamera object (gives access to camera functionalities), the programm fails link(?) and gives me following errors:
:: error: undefined reference to '_imp__ZN9CFGCameraD1Ev'
:: error: undefined reference to '_imp__ZN9CFGCameraD1Ev'
:: error: undefined reference to '_imp__ZN9CFGCameraD1Ev'
:: error: collect2: ld returned 1 exit status
Since I use the MinGW compiler, I think that the following thread in AVT's Knowledge Base is the solution to my problems:
FireGrab with Dev C++ and MinGW/GCC compiler
The CFGCamera object of the MS VS C++ library FGCamera.lib could not be converted to MinGW compatible *.a library. That's why there's the C-wrapper FGWrap.dll providing the functions of the FireGrab interface to a camera handle instead of an CFGCamera object.
The FireGrab\Lib\Extra\FGWrap.lib could be loaded to your Dev C++ project easily as shown at the modified WrapSample.
FGCamera.lib has to be included just to initialize the module and get the nodelist.
But even with this approach I cannot access the camera. Can somebody tell me what I am doing wrong? My .pro-file now looks like this:
INCLUDEPATH += C:/FirePackage/FireGrab/Lib/Extra
LIBS += C:/FirePackage/FireGrab/Lib/Extra/FGWrap.lib
LIBS += C:/FirePackage/FireGrab/Lib/FGCamera.lib
INCLUDEPATH += C:/FirePackage/FireGrab/Lib/Extra
LIBS += C:/FirePackage/FireGrab/Lib/Extra/FGWrap.lib
LIBS += C:/FirePackage/FireGrab/Lib/FGCamera.lib
To copy to clipboard, switch view to plain text mode
The Lib folder contains following files:
- FGCamara.dll
- convert.c
- basetype.h
- convert.h
- errstat.h
- FGCamera.h
- FGCamera.lib
- FGCamera_omf.lib
The Extra folder contains following files:
- FGWrap.dll
- Camera.h
- FGWrap.h
- IsoDma.h
- FGWrap.cpp
- FGWrap.lib
- FGWrap_omf.lib
My main.cpp:
#include <fgcamera.h>
#include <fgwrap.h>
int main(int argc, char *arbv[])
{
FGHandle hCamera; //this is the substitute for the CFGCamera object
FGNODEINFO NodeInfo[3];
UINT32 NodeCnt;
FGInitModule(NULL);
FGGetNodeList(NodeInfo,3,&NodeCnt);
hCamera = NULL;
FGGetCameraHandle(&hCamera,&NodeInfo[0].Guid,NULL); //here it exits
...
return a.exec();
}
#include <fgcamera.h>
#include <fgwrap.h>
int main(int argc, char *arbv[])
{
QApplication a(argc, argv);
FGHandle hCamera; //this is the substitute for the CFGCamera object
FGNODEINFO NodeInfo[3];
UINT32 NodeCnt;
FGInitModule(NULL);
FGGetNodeList(NodeInfo,3,&NodeCnt);
hCamera = NULL;
FGGetCameraHandle(&hCamera,&NodeInfo[0].Guid,NULL); //here it exits
...
return a.exec();
}
To copy to clipboard, switch view to plain text mode
When I execute it, it exits at the mentioned line with a return value -1073741515. Since this is adapted from a sample I am pretty sure that the parameters etc. are fine. I could access the camera with MSVS2010 Express as well, no problem.
So how do I use the wrapper? Maybe someone could test it on his system, the library can be downloaded here.
Another possibility might be to generate a MinGW compatible library from FGCamera.dll with pexports(!?), but I don't know how to do that and if it's feasible, because AVT says it is not (see above).
Last to mention my setup:
Qt 4.7.0
Qt Creator 2.0.1
MinGW-Compiler
Windows 7
Sorry for cross-posting(?), but initially I picked up an old thread in the Qt-programming forum. I didn't want to bother them with newbie questions anymore.
Thanks for your assistance.
Bookmarks