且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Eclipse C/C++ (CDT) 添加 -l 选项(链接数学模块) gcc -lm

更新时间:2022-01-08 00:52:36

沿着这个路径:Project->Properties->C/C++ Build->Settings,然后在 Tools 选项卡下:GCC Linker->Libraries

Somewhere along this path: Project->Properties->C/C++ Build->Settings, then under the Tools tab: GCC Linker->Libraries

至于在系统的哪个位置,一般是/usr/lib/libm.so.

As for where it is in the system, usually /usr/lib/libm.so.

仅供参考,这对我的系统来说都是正确的,但由于多种原因,您的系统可能会略有不同.如果需要,应该不难调整.

FYI, this is all true of my system, but may differ slightly on yours for any number of reasons. Shouldn't be hard to adjust if needed.