Building mex-file using CL-Eye-API

Hello,
I am trying to build some mex files to handle the PS3 camera using the CL-Eye-Platform API by Code Laboratories. Just to get started using the API, i have:
#include "mex.h"
#include "matrix.h"
#include <stdlib.h>
#include "CLEyeHandler.h"
// Gateway routine
void
mexFunction(int nlhs,mxArray *plhs[],int nrhs,const mxArray *prhs[])
{
// Query connected camera
if(CLEyeGetCameraCount() == 0)
{
mexErrMsgTxt("No PS3Eye camera detected\n");
}
mexPrintf("Capturing initialized!\n");
return;
} // mexfunction
Compilation using
mex mexCLEye_init.cpp CLEyeMulticam.lib
ends without errors, but when i call the mex-function, Matlab either (i have no idea depending on what...) just
crashes , or it throws some error message like:
"Invalid mex file 'mexCLEye_init.mexw32': Invalid access to memory location".
In both cases debugging shows that loading the mex-file gets stuck when attepting to load CLEyeMulticam.dll. Both, .lib and .dll are located in the current directory. I tried different ways, linking with -l/-L options, modifiying mexopts.bat to link with the library and writing some wrapper for the API's function and then linking with the resulting object file. In any case I end up with the same problem, so it appears to me my way of linking is correct, but theres some other issue with Matlab handling the .dll.
I am using Microsoft Visual C++ 2008 SP1 compiler as it is demanded in the API's documentation.
Some posts on Code Laboratories forum suggest, that the API isn't working with newer versions of matlab anymore... Iam using Matlab 2012a and CL-Eye Platform SDK 1.4.0.0230.
Any hints or ideas are appreciated!
Chris

Respuestas (0)

Categorías

Preguntada:

el 16 de En. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by