Borrar filtros
Borrar filtros

Using C Header files with loadlibrary

4 visualizaciones (últimos 30 días)
Lab Rat
Lab Rat el 8 de Abr. de 2014
Editada: Philip Borghesani el 8 de Abr. de 2014
Hi,
We are trying to use a dll file provided by FTDI in order to communicate with an FTDI chip which in turn uses I2C to communicate with the dut. We are trying to use the dll as well as the header files provided by FTDI. However, we seem to receiving the following warnings:
Type 'PVOID' was not found. Defaulting to type error.
Found on line 31 of input from line 59 of file C:\Program Files\MATLAB\R2010a\ftd2xx.h
Type 'ULONG' was not found. Defaulting to type error.
Found on line 32 of input from line 60 of file C:\Program Files\MATLAB\R2010a\ftd2xx.h
Type 'ULONG' was not found. Defaulting to type error.
Found on line 161 of input from line 189 of file C:\Program Files\MATLAB\R2010a\ftd2xx.h
Type 'WORD' was not found. Defaulting to type error.
Found on line 628 of input from line 656 of file C:\Program Files\MATLAB\R2010a\ftd2xx.h
Type 'WORD' was not found. Defaulting to type error.
Found on line 628 of input from line 656 of file C:\Program Files\MATLAB\R2010a\ftd2xx.h
Type 'WORD' was not found. Defaulting to type error.
Found on line 628 of input from line 656 of file C:\Program Files\MATLAB\R2010a\ftd2xx.h
Type 'WORD' was not found. Defaulting to type error.
Found on line 628 of input from line 656 of file C:\Program Files\MATLAB\R2010a\ftd2xx.h
We found the datatypes to be in the windows.h header file so we are trying to use the windows.h header file using the following line:
[warnings notfound] = loadlibrary('libMPSSE.dll","libMPSSE_I2C.h",'addheader','windows');
But we still seem to see the warnings. Some of the data structures in the dll require the datatypes so we are running into issues with it. Can someone give us any pointers ?

Respuestas (1)

Philip Borghesani
Philip Borghesani el 8 de Abr. de 2014
Editada: Philip Borghesani el 8 de Abr. de 2014
You are making a common mistake interpreting the functionality of the addheader function. It will not help in this situation, the documentation attempts to make that clear. You must edit libMPSSE_I2C.h to add an include statement for windows.h or create a new header (myheader.h) containing:
#include <windows.h>
#include <libMPSSE_I2C.h>
Then issue
[warnings notfound] = loadlibrary('libMPSSE.dll","myheader",'addheader','libMPSSE_I2C');
The addheader function tells loadlibrary look for functions in a #included header file as well as in the main header file used with loadlibrary.

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by