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

发布于 2024-12-20 15:12:42 字数 138 浏览 6 评论 0原文

我正在尝试让 linux (Ubuntu) 上的 eclipse 链接数学模块。 通常我会与 gcc -lm 链接。我如何让 Eclipse 添加这个? 它位于“项目”->“属性”下的库路径中吗?数学模块驻留在 Linux Ubuntu 系统上的什么位置?

I am trying to have eclipse on linux (Ubuntu) link the math module.
Normally I would link with gcc -lm. How do I get eclipse to add this?
Is it in library paths under Project->Properties? Where does the math module reside on a linux Ubuntu system?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

奶茶白久 2024-12-27 15:12:42

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

至于它在系统中的位置,通常是/usr/lib/libm 。所以。

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

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

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.

心病无药医 2024-12-27 15:12:42

转到项目并选择属性
展开C/C++ 构建并选择设置
工具设置选项卡下,展开GCC链接器并选择
在窗口右侧的Libraries (-l)处添加一个名为m的库。

Go to Project and select Properties.
Expand C/C++ Build and choose Settings.
Under the Tool settings tab expand GCC Linker and select Libraries.
At the right of the window, add a library named m at Libraries (-l).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文