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 ?
댓글 수: 0
답변 (1개)
Philip Borghesani
2014년 4월 8일
편집: 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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!