Eclipse C/C++ (CDT) 添加 -l 选项(链接数学模块) gcc -lm
我正在尝试让 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
沿着这条路径的某个地方: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.
转到项目并选择属性。
展开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).