Camera SDK + Qt = runtime error

Adun
Posts: 12
Joined: Tue Sep 29, 2009 10:42 pm

Camera SDK + Qt = runtime error

Post by Adun » Tue Jan 11, 2011 11:27 am

Hi guys!
I try to integrate Camera SDK beta and Qt 4.7.0 under MSVC 2008
So I got runtime error in this simple code. So there is no debug library so I can't trace error.
int main(int argc, char *argv[])
{
CameraLibrary_EnableDevelopment();

//== Initialize connected cameras ==========----

CameraManager::X().WaitForInitialization();


//== Get a connected camera ================----

Camera* camera = CameraManager::X().GetCamera();

if(camera==0)
{
MessageBox(0,"Please connect a camera","No Device Connected", MB_OK);
// return 1;
}

//== Determine camera resolution to size application window ==----

int cameraWidth = camera->Width();
int cameraHeight = camera->Height();

int WindowWidth = 800;
int WindowHeight = 450;


camera->SetVideoType(SegmentMode);

//== Start camera output ==--

camera->Start();

//== Turn on some overlay text so it's clear things are ===---
//== working even if there is nothing in the camera's view. ===---

camera->SetTextOverlay(false);

QApplication a(argc, argv);
qt1 w;
return a.exec();
}

Adun
Posts: 12
Joined: Tue Sep 29, 2009 10:42 pm

Re: Camera SDK + Qt = runtime error

Post by Adun » Wed Jan 12, 2011 12:51 am

Using this I can get only 10 frames. I tried also release SDK ( not beta) got the same result.

beckdo
NaturalPoint Employee
NaturalPoint Employee
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Camera SDK + Qt = runtime error

Post by beckdo » Thu Jan 13, 2011 11:57 am

Have you built QT via the VS compiler and are using the QT VS plug-in within visual studio?

You're going to find that trying to integrate the Camera SDK directly into a mingw/QT IDE based app will not work correctly.

Adun
Posts: 12
Joined: Tue Sep 29, 2009 10:42 pm

Re: Camera SDK + Qt = runtime error

Post by Adun » Thu Jan 13, 2011 12:12 pm

the problem is heap corruption if I use qt 4.7.1 pre built in MSVC 2008 in DLL form
When I recompile QT to static linking all fine. In your examples you use /MT flag not /MD flag and QT was built with this flag - so maybe here is the problem.

beckdo
NaturalPoint Employee
NaturalPoint Employee
Posts: 520
Joined: Tue Jan 02, 2007 2:02 pm

Re: Camera SDK + Qt = runtime error

Post by beckdo » Thu Jan 13, 2011 6:44 pm

Yes, the cameralibrary.dll is compiled with /MT. I've compiled a build for you with it set to /MD so you can try it. Please email support and let us know if that solves your problem.

Adun
Posts: 12
Joined: Tue Sep 29, 2009 10:42 pm

Re: Camera SDK + Qt = runtime error

Post by Adun » Thu Jan 13, 2011 11:27 pm

Thanx, but I haven't got your dll. Have you send it to me?
Please send it to email in my profile or to another one grigoriev177 _at_ gmail.com

VincentG
Posts: 7728
Joined: Mon Jul 17, 2006 5:00 am
Location: Corvallis, Oregon

Re: Camera SDK + Qt = runtime error

Post by VincentG » Fri Jan 14, 2011 5:13 pm

We tried to email the file to you, but gmail does not accept attachments of that file type

Adun
Posts: 12
Joined: Tue Sep 29, 2009 10:42 pm

Re: Camera SDK + Qt = runtime error

Post by Adun » Mon Jan 17, 2011 10:56 pm

I still haven't got your DLL, maybe you zip DLL and send it?

VincentG
Posts: 7728
Joined: Mon Jul 17, 2006 5:00 am
Location: Corvallis, Oregon

Re: Camera SDK + Qt = runtime error

Post by VincentG » Wed Jan 19, 2011 12:04 pm

resent to your .ru account

Adun
Posts: 12
Joined: Tue Sep 29, 2009 10:42 pm

Re: Camera SDK + Qt = runtime error

Post by Adun » Wed Feb 02, 2011 12:56 am

All works fine
But I can't find in your new cameradll such properties like
object_mass_min,object_mass_max end etc.
Do you cancel to use them in new functionality?

Post Reply