問(wèn)題描述
我正在嘗試讓 linux (Ubuntu) 上的 eclipse 鏈接數(shù)學(xué)模塊.通常我會(huì)與 gcc -lm 鏈接.如何讓 eclipse 添加這個(gè)?它是否在 Project->Properties 下的庫(kù)路徑中?數(shù)學(xué)模塊位于 linux Ubuntu 系統(tǒng)的什么位置?
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?
推薦答案
沿著這個(gè)路徑:Project->Properties->C/C++ Build->Settings,然后在 Tools 選項(xiàng)卡下:GCC Linker->Libraries
Somewhere along this path: Project->Properties->C/C++ Build->Settings, then under the Tools tab: GCC Linker->Libraries
至于在系統(tǒng)的哪個(gè)位置,一般是/usr/lib/libm.so.
As for where it is in the system, usually /usr/lib/libm.so.
僅供參考,這對(duì)我的系統(tǒng)來(lái)說(shuō)都是正確的,但由于多種原因,您的系統(tǒng)可能會(huì)略有不同.如果需要,應(yīng)該不難調(diào)整.
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.
這篇關(guān)于Eclipse C/C++ (CDT) 添加 -l 選項(xiàng)(鏈接數(shù)學(xué)模塊) gcc -lm的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!