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

Eclipse C/C++ (CDT) add -l option (linking math module) gcc -lm(Eclipse C/C++ (CDT) 添加 -l 选项(链接数学模块) gcc -lm)
本文介绍了Eclipse C/C++ (CDT) 添加 -l 选项(链接数学模块) gcc -lm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试让 linux (Ubuntu) 上的 eclipse 链接数学模块.通常我会与 gcc -lm 链接.如何让 eclipse 添加这个?它是否在 Project->Properties 下的库路径中?数学模块位于 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?

推荐答案

沿着这个路径: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.

这篇关于Eclipse C/C++ (CDT) 添加 -l 选项(链接数学模块) gcc -lm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
Spring MVC LocaleChangeInterceptor annotation based doesn#39;t work(基于 Spring MVC LocaleChangeInterceptor 注释不起作用)
How to get the default ResourceBundle regardless of current default Locale(无论当前的默认语言环境如何,如何获取默认 ResourceBundle)
If you have the ISO country code `US`, `FR`, how do you get the Locale code (`Locale.US`, `Locale.FRANCE`)?(如果您有 ISO 国家代码 `US`、`FR`,如何获得区域设置代码(`Locale.US`、`Locale.FRANCE`)?)