問題描述
我正在嘗試讓 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!