1518 views|0 replies

230

Posts

2

Resources
The OP
 

[Project source code] Using math library in Linux application reports undefined reference to `sin', etc. [Copy link]

 

This article and design code were written by FPGA enthusiast Xiao Meige. Without the author's permission, this article is only allowed to be copied and reproduced on online forums, and the original author must be indicated when reprinting.


This problem occurs because in Linux, functions such as sin and sqrt are in the libm.so library file, not in math.h.
Solution: In the gcc compilation environment of Ubuntu, just use the lm parameter, for example, gcc -o Gen Gen.c -lm.
In the Eclipse integrated development environment, you can add the libm library to the settings to achieve this, as shown below:

This post is from Altera SoC
 
 

Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list