Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading a .dll in Matlab causes 'type not found' problems
    primarykey
    data
    text
    <p>I've been hoping to play around with [this nifty C++ dll][1] in Matlab, since I've got some existing Matlab stuff that I think could benefit from this library's functionality. However, whenever I run this command to load the library:</p> <pre><code>loadlibrary('d3d9Callback.lib','d3d9Callback.h') </code></pre> <p>I get a nasty ammount of warnings regarding the existance of types used in the dll, and a crazy number of syntax errors, obviously stemming from the unknown types. Here's the start of the warnings/errors:</p> <pre><code> Warning: Warnings messages were produced while parsing. Check the functions you intend to use for correctness. Warning text can be viewed using: [notfound,warnings]=loadlibrary(...) &gt; In loadlibrary at 360 Error loading library intermediate output follows. The actual error is at the end of this output. ********* Type 'intCONSTDWORDPtr' was not found. Defaulting to type voidPtr. Found on line 29 of input from line 28 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 29 of input from line 28 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTDWORDPtr' was not found. Defaulting to type voidPtr. Found on line 30 of input from line 29 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 30 of input from line 29 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DSURFACE_DESCPtr' was not found. Defaulting to type voidPtr. Found on line 35 of input from line 34 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'BitmapPtr' was not found. Defaulting to type voidPtr. Found on line 35 of input from line 34 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 35 of input from line 34 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'BufferLockDataPtr' was not found. Defaulting to type voidPtr. Found on line 36 of input from line 35 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DVERTEXBUFFER_DESCPtr' was not found. Defaulting to type voidPtr. Found on line 36 of input from line 35 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'BufferLockDataPtr' was not found. Defaulting to type voidPtr. Found on line 37 of input from line 36 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DINDEXBUFFER_DESCPtr' was not found. Defaulting to type voidPtr. Found on line 37 of input from line 36 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 39 of input from line 38 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLEPtr' was not found. Defaulting to type voidPtr. Found on line 44 of input from line 43 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTD3DVIEWPORT9Ptr' was not found. Defaulting to type voidPtr. Found on line 46 of input from line 45 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DTRANSFORMSTATETYPE' was not found. Defaulting to type error. Found on line 47 of input from line 46 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTD3DMATRIXPtr' was not found. Defaulting to type voidPtr. Found on line 47 of input from line 46 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DVERTEXELEMENT9Ptr' was not found. Defaulting to type voidPtr. Found on line 49 of input from line 48 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 51 of input from line 50 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTD3DLIGHT9Ptr' was not found. Defaulting to type voidPtr. Found on line 54 of input from line 53 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'BOOL' was not found. Defaulting to type error. Found on line 55 of input from line 54 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTD3DMATERIAL9Ptr' was not found. Defaulting to type voidPtr. Found on line 57 of input from line 56 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DRENDERSTATETYPE' was not found. Defaulting to type error. Found on line 59 of input from line 58 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DTEXTURESTAGESTATETYPE' was not found. Defaulting to type error. Found on line 60 of input from line 59 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 62 of input from line 61 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 64 of input from line 63 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 65 of input from line 64 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTBOOLPtr' was not found. Defaulting to type voidPtr. Found on line 67 of input from line 66 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTfloatPtr' was not found. Defaulting to type voidPtr. Found on line 68 of input from line 67 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTUINTPtr' was not found. Defaulting to type voidPtr. Found on line 69 of input from line 68 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTBOOLPtr' was not found. Defaulting to type voidPtr. Found on line 71 of input from line 70 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTfloatPtr' was not found. Defaulting to type voidPtr. Found on line 72 of input from line 71 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTUINTPtr' was not found. Defaulting to type voidPtr. Found on line 73 of input from line 72 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'HANDLE' was not found. Defaulting to type error. Found on line 75 of input from line 74 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DPRIMITIVETYPE' was not found. Defaulting to type error. Found on line 80 of input from line 79 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DPRIMITIVETYPE' was not found. Defaulting to type error. Found on line 81 of input from line 80 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DPRIMITIVETYPE' was not found. Defaulting to type error. Found on line 82 of input from line 81 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'INT' was not found. Defaulting to type error. Found on line 82 of input from line 81 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DPRIMITIVETYPE' was not found. Defaulting to type error. Found on line 83 of input from line 82 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTvoidPtr' was not found. Defaulting to type voidPtr. Found on line 83 of input from line 82 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DPRIMITIVETYPE' was not found. Defaulting to type error. Found on line 84 of input from line 83 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTvoidPtr' was not found. Defaulting to type voidPtr. Found on line 84 of input from line 83 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DFORMAT' was not found. Defaulting to type error. Found on line 84 of input from line 83 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTvoidPtr' was not found. Defaulting to type voidPtr. Found on line 84 of input from line 83 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTRECTPtr' was not found. Defaulting to type voidPtr. Found on line 89 of input from line 88 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTRECTPtr' was not found. Defaulting to type voidPtr. Found on line 89 of input from line 88 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'intCONSTD3DRECTPtr' was not found. Defaulting to type voidPtr. Found on line 90 of input from line 89 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Type 'D3DCOLOR' was not found. Defaulting to type error. Found on line 90 of input from line 89 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Failed to parse type 'D3D9Base :: LPDIRECT3DDEVICE9 Device' original input 'D3D9Base :: LPDIRECT3DDEVICE9 Device ' Found on line 101 of input from line 100 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h Error parsing argument for function ReportCreateDevice function may be invalid. Type 'ID3D9DeviceOverlayPtr' was not found. Defaulting to type voidPtr. Found on line 101 of input from line 100 of file C:\\Users\\Steven\\Dropbox\\Stanford_SC2bot\\D3D9CallbackSC2\\Base\\d3d9Callback.h ********* ??? Error using ==&gt; loadlibrary at 441 Building d3d9Callback_thunk_pcwin64 failed. Compiler output is: cl -I"C:\Program Files\MATLAB\R2011a\extern\include" /Zp8 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /nologo -I"C:\Users\Steven\Dropbox" -I"C:\Users\Steven\Dropbox\Stanford_SC2bot\D3D9CallbackSC2\Base" "d3d9Callback_thunk_pcwin64.c" -LD -Fe"d3d9Callback_thunk_pcwin64.dll" d3d9Callback_thunk_pcwin64.c C:\Users\Steven\Dropbox\Stanford_SC2bot\D3D9CallbackSC2\Base\d3d9Callback.h(28) : error C2146: syntax error : missing ')' before identifier 'DWORD' C:\Users\Steven\Dropbox\Stanford_SC2bot\D3D9CallbackSC2\Base\d3d9Callback.h(28) : error C2061: syntax error : identifier 'DWORD' C:\Users\Steven\Dropbox\Stanford_SC2bot\D3D9CallbackSC2\Base\d3d9Callback.h(28) : error C2059: syntax error : ';' </code></pre> <p>Now I've checked the Matlab forums and tried the usual suspects (setting the c++ compiler, making sure its not a 64bit dll on a 32 bit Matlab, and making sure the dll is 'extern c'). I'm beginning to think the problem is that problem is that the dll draws heavily from the directx libraries and well as an additional dll from the same website. Perhaps Matlab doesn't know about them, and that's causing the 'type unknown' problems? Thats the only thing I can think of, but it doesn't make sense to me since the library being loaded has already been compiled into a dll.</p> <p>Anyways, I'm quite new to dealing with dlls, so my intuition might be way off. Any thoughts about why Matlab can't recognize the types and how I might go about fixing the problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload