|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
代码: srd.step_delay = (int32_t)((T1_FREQ_148 * sqrt(A_SQ / accel))/10);
* \' c, F: {: j: L% [/ j9 u$ @6 v& w9 U4 z1 W, e# J n* q
中使用了sqrt,在board.h中也包含了9 c( _0 F( }" t! P8 C1 I
( v# {7 \/ {/ Zinclude
8 q6 ]* G3 ]4 l, X2 |+ O% s" h3 i# y
2 o3 V, d4 j3 |, ainclude
+ d4 A* R3 K" j1 _9 R+ b( w4 U8 j: W- s/ \0 v" c" U
include “math.h”
- i0 H3 q1 y' }3 B) J2 T$ p4 k" y
. q) z2 o9 f1 l% {! Binclude: K% _3 A: _: o2 Z
* h0 n; t/ Z( b! Q
但是编译后报错:/ S) F' f7 k9 ^, k
! t( g c- }' |# z, G1 ]9 v! |
undefined reference to `sqrt’ ,6 E3 L' j$ v3 j6 j
" O& N* Q) ^- M& `% s
工程中能找到math.h文件,里面能看到:extern double sqrt _PARAMS((double));# }- |, b" P' w3 j3 t
|
|