Using C Header files with loadlibrary

9 次查看(过去 30 天)
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 ?

回答(1 个)

Philip Borghesani
编辑:Philip Borghesani 2014-4-8
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.

类别

Help CenterFile Exchange 中查找有关 Data Type Identification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by