I got this crazy error out of my matlab code and i know you guys dont know matlab nessasarily but i have bolded the interesting part. I was just wondering if you had any insight.
what i did was link to DTEST.dll
I inlcuded the header DLLTEST.h seen here:
Code:
#include "niimaq.h"
#include "stdint.h"
// Error display function
extern "C" __declspec(dllexport) void DisplayIMAQError(int32_t error);
//
// Callbacks
extern "C" __declspec(dllexport) int AnalogueCardInit(uint32_t *Sid, uint32_t *Iid, uint8_t *image1D, uint8_t **image2D);
extern "C" __declspec(dllexport) int AnalogueCardClose(uint32_t *Sid, uint32_t *Iid);
extern "C" __declspec(dllexport) int AnalogueCardSnap(uint32_t Sid, uint8_t *ImaqBuffer, uint32_t top, uint32_t left, uint32_t height, uint32_t width);
i also inlcuded (just like #inlcude) stdint.h and another header which has the prototypes for another library DTEST.dll links to:
Code:
USER_FUNC imgInterfaceOpen(const int8_t* interface_name, uint32_t* ifid);
USER_FUNC imgSessionOpen(uint32_t ifid, uint32_t* sid);
USER_FUNC imgClose(uint32_t void_id, uint32_t freeResources);
USER_FUNC imgSnap(uint32_t sid, void **bufAddr);
USER_FUNC imgSnapArea(uint32_t sid, void **bufAddr,uint32_t top,uint32_t left, uint32_t height, uint32_t width,uint32_t rowBytes);
USER_FUNC imgGrabSetup(uint32_t sid, uint32_t startNow);
USER_FUNC imgGrab(uint32_t sid, void** bufPtr, uint32_t syncOnVB);
USER_FUNC imgGrabArea(uint32_t sid, void** bufPtr, uint32_t syncOnVB, uint32_t top, uint32_t left, uint32_t height, uint32_t width, uint32_t rowBytes);
USER_FUNC imgRingSetup(uint32_t sid, uint32_t numberBuffer,void* bufferList[], uint32_t skipCount, uint32_t startnow);
USER_FUNC imgSequenceSetup(uint32_t sid, uint32_t numberBuffer,void* bufferList[], uint32_t skipCount[], uint32_t startnow, uint32_t async);
USER_FUNC imgSessionStartAcquisition(uint32_t sid);
USER_FUNC imgSessionStopAcquisition(uint32_t sid);
USER_FUNC imgSessionStatus(uint32_t sid, uint32_t* boardStatus, uint32_t* bufIndex);
USER_FUNC imgSessionConfigureROI(uint32_t sid, uint32_t top, uint32_t left, uint32_t height, uint32_t width);
USER_FUNC imgSessionGetROI(uint32_t sid, uint32_t* top, uint32_t* left, uint32_t* height, uint32_t* width);
USER_FUNC imgSessionGetBufferSize(uint32_t sid, uint32_t* sizeNeeded);
USER_FUNC imgGetAttribute(uint32_t void_id, uint32_t type, void* value);
USER_FUNC imgCreateBuffer(uint32_t sid, uint32_t where, uint32_t bufferSize, void** bufAddr);
USER_FUNC imgDisposeBuffer(void* bufferPtr);
USER_FUNC imgShowError(uint32_t error, int8_t* text);
Code:
loadlibrary DTEST.dll DLLTEST.h addheader stdint.h addheader niimaq.h
Warning: Message from C preprocessor:
lcc preprocessor warning: C:\Program Files\MATLAB\R2006a\work\MATLAB\stdint.h:33 C:\Program Files\MATLAB\R2006a\work\MATLAB\DLLTEST.h:2 #error directive: "Use this header only with Microsoft Visual C++ compilers!"
> In loadlibrary at 218
??? Error using ==> loadlibrary
Call to Perl failed. Possible error processing header file.
Output of Perl command:
Error using ==> perl
System error: Working string is 'typedef __int8 int8_t ;'.
ERROR: Attempt to redefine 'error' current definition int8 new definition error.
Found on line 2030 of input from line 59 of file C:\Program Files\MATLAB\R2006a\work\MATLAB\stdint.h
Command executed: perl "C:\Program Files\MATLAB\R2006a\toolbox\matlab\general\private\prototypes.pl" DLLTEST.i -outfile=DTEST_proto.m stdint.h niimaq.h
Error in ==> loadlibrary at 273
diagnoseError(err);