發(fā)現(xiàn)很奇怪,
sqrtf(0.5) 可以,但是換成變量就不行了。
編譯報(bào)錯(cuò)
undefined reference to `sqrtf'
代碼如下:
#include "debug.h"
#include
int main(void)
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
Delay_Init();
USART_Printf_Init(115200);
printf("SystemClk:%d\r\n",SystemCoreClock);
printf("This is printf example\r\n");
const volatile float c = 0.00006;
float b = c;
//memcpy(&b, &c, sizeof(b));
float a = sqrtf(b);
while(1)
? ? {
}
}
求解 謝謝!