Not applicable
Mar 13, 2013
05:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 13, 2013
05:18 AM
Hi.
The following source generates the fault code "../Main.c:27: undefined reference to `sqrt'"
#include //Declarations from DAVE3 Code Generation (includes SFR declaration)
#include
#include
double dbDestination, dbSource;
int main(void)
{
DAVE_Init(); // Initialization of DAVE Apps
dbSource = 9;
dbDestination = sqrt(dbSource);
while(1)
{
}
return 0;
}
Does anyone know this problem ?
Thank you in advance,
Rudi
The following source generates the fault code "../Main.c:27: undefined reference to `sqrt'"
#include
#include
#include
double dbDestination, dbSource;
int main(void)
{
DAVE_Init(); // Initialization of DAVE Apps
dbSource = 9;
dbDestination = sqrt(dbSource);
while(1)
{
}
return 0;
}
Does anyone know this problem ?
Thank you in advance,
Rudi
- Tags:
- IFX
1 Reply
Not applicable
Mar 13, 2013
05:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 13, 2013
05:26 AM
You have to tell the linker to link the math libraries.
You can do this in project properties -> tool settings -> ARM gcc linker -> Libraries.
You have to click add and then type an 'm' in the popup window,
this will link the math libraries with your project and solve your problem.
You can do this in project properties -> tool settings -> ARM gcc linker -> Libraries.
You have to click add and then type an 'm' in the popup window,
this will link the math libraries with your project and solve your problem.