- Highlight your project in the Solution Explorer, and then select “Project > Properties”.
- Under “Configuration Properties > C/C++ > General”, add the folders C:\{Path to your project folder}\codegen\dll\dspfft and matlabroot\extern\include to “Additional Include Directories”. Separate the entries with a semicolon.
- Under “Configuration Properties > Linker > Input”, add dspfft.lib to “Additional Dependencies”.
- Under “Configuration Properties > Linker > General”, add the folder C:\ {Path to your project folder}\ \codegen\dll\dspfft to “Additional Library Directories”.
Creating Visual studio project with MATLAB coder generated code
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi Mathworks,
I have generated the source code for the my matlab function using the MATLAB coder. I am also using a call to dsp.IFFT() in my code which has created a dspfft.dll dependency in my generated C code. I am trying to establish a visual studio solution to debug and run the generated code with custom main file. I have also used the packNgo function to package all generated code dependencies into zip before adding source in Visual studio. I am getting the following error in visual studio when the source code is trying to load this libray :
Could not open library: dspfft.dll.
To run the generated code outside the MATLAB environment, use the packNGo function.
Error: Could not open library: dspfft.dll.
To run the generated code outside the MATLAB environment, use the packNGo function.
Please let us know what what changes need to made to generated c source code to migrate into visual studio environment or how to setup other dependencies on the side of visual studio.
Note : Both the Matlab coder and DSP system toolbox are the latest version and licences for the same have been purchased.
Thanks and regards,
Kaushik Gowda
0 Kommentare
Antworten (1)
Harsh
am 23 Jan. 2025
Hi Kaushik,
Visual Studio is unable to open the “dspfft.dll” library, which is causing the error you are encountering. To setup external dependencies in Visual Studio please follow the below steps:
Refer to the following documentation for more information regarding this - https://www.mathworks.com/help/releases/R2021b/coder/ug/use-a-c-dynamic-library-in-microsoft-visual-studio-project.html
You may check the following “MATLAB Coder Interface for Visual Studio Code Debugging” from file exchange to debug the code generated by MATLAB coder in Visual Studio Code - https://www.mathworks.com/matlabcentral/fileexchange/103555-matlab-coder-interface-for-visual-studio-code-debugging
0 Kommentare
Siehe auch
Kategorien
Mehr zu C Code Generation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!