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
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Call C++ from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!