error C2440 While using MATLAB Coder with Custom FFT library callback
3 ビュー (過去 30 日間)
古いコメントを表示
Murali Kannan Thiraviam
2017 年 12 月 6 日
回答済み: Ryan Livingston
2017 年 12 月 19 日
I have simple script function [RetVal] = MatLabFFTW(CapWave) TempVal = fft(CapWave); RetVal = real(sum(TempVal)); end
When I tried to convert this script to DLL using Coder; I got following compilation errors:
Script\codegen\dll\MatLabFFTW\MatLabFFTW.cpp(102) : error C2440: '=' : cannot convert from 'void ' to 'double *' Conversion from 'void' to pointer to non-'void' requires an explicit cast Script\codegen\dll\MatLabFFTW\MatLabFFTW.cpp(110) : error C2440: '=' : cannot convert from 'void ' to 'fftw_complex (*)' Conversion from 'void' to pointer to non-'void' requires an explicit cast Script\codegen\dll\MatLabFFTW\MatLabFFTW.cpp(111) : error C2664: 'void fftw_execute_dft_r2c(const fftw_plan,double ,fftw_complex (*))' : cannot convert argument 1 from 'void *' to 'const fftw_plan' Conversion from 'void' to pointer to non-'void' requires an explicit cast Script\codegen\dll\MatLabFFTW\MatLabFFTW.cpp(146) : error C2440: '=' : cannot convert from 'void ' to 'double *' Conversion from 'void' to pointer to non-'void' requires an explicit cast Script\codegen\dll\MatLabFFTW\MatLabFFTW.cpp(147) : error C2440: '=' : cannot convert from 'void ' to 'fftw_complex (*)' Conversion from 'void' to pointer to non-'void' requires an explicit cast Script\codegen\dll\MatLabFFTW\MatLabFFTW.cpp(189) : error C2664: 'void fftw_destroy_plan(fftw_plan)' : cannot convert argument 1 from 'void ' to 'fftw_plan' Conversion from 'void' to pointer to non-'void' requires an explicit cast
Note: 1) I am using the Custom FFT library callback option to use our own FFTW 2) When select the language as 'C' then there is no problem in compiling the DLL but choosing C++ giving this compiler error 3) I am using Visual Studio 2013 compiler
Please help me to solve this issue.
0 件のコメント
採用された回答
Ryan Livingston
2017 年 12 月 19 日
This is a bug and has been reported to the MATLAB Coder development team. Thank you for reporting it.
As you've seen, generating C code will work around the issue.
0 件のコメント
その他の回答 (0 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!