Dear all,
This is my first project in Keil uVision and I have also little experience with embedded design. I would like to simulate some DSP code written in C++ on STM32F4 Discovery board. The code contains a lot of functions - sin, cos, sqrt, log, exp etc and includes the corresponding c++ libraries cmath, cfloat. What should I do to be able to use these functions?
I have tried to specify the following library paths in Options for Target -> C/C++ -> Include paths
"C:\Keil_v5\ARM\ARMCC\lib";"C:\Keil_v5\ARM\ARMCC\include"
But get an error message for every use of these functions, which looks like:
BlkDsp.cpp(491): error: #20: identifier "cos" is undefined c1 = 2.0*cos(tmp); c2 = sin(tmp);
Sorry for my little knowledge. I will be thankfull for any hint!
library != include
An include file describes the interface, a library provides the code.
#include <math.h> // ??
You'd want to double check what libraries/options you have set up in the project, like if you have full math libraries or floating point support enabled. In some cases you'd drop a .A or .LIB file directly into the project.
Thank you, Westonsupermare Pier! Where are the actual library files are located? Do they come with the installation? I included the following folder to Options for Target -> C/C++: "C:\Keil_v5\ARM\ARMCC\lib" But that didn't help, although I can see that the file extensions there are different - .l and .b, so probably these are not the files I need... How do I know what files should be dropped to the project?
This issue is now resolved! After adding an
--using_std
as a compiler option, the code compiled fine! Apparently, this was not a linking problem. Thanks to ARM Compiler Software Development Guide!