Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse C/C++ (CDT) add -l option (linking math module) gcc -lm

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?

like image 357
eat_a_lemon Avatar asked Dec 12 '11 19:12

eat_a_lemon


People also ask

What is CDT in Eclipse?

The C/C++ Development Toolkit (CDT) is a set of Eclipse plug-ins that provide C and C++ extensions to the Eclipse workbench. For more information about Eclipse, see Workbench User Guide > Concepts > Workbench. The CDT provides a C/C++ IDE that simplifies many of the same tools that you can use from the command line.

Can I code C on Eclipse?

Eclipse is popular for Java project development. It also supports C/C++, PHP, Python, Perl, and other web project developments via extensible plug-ins. Eclipse is cross-platform and runs under Windows, Linux and Mac OS.

How do I get C++ in Eclipse?

In Eclipse, go to the "File" menu, then "New", then "C++ Project" if it's there. If not, choose "Project", then find "C/C++" in the list of wizards, click the "+" sign to expand it, and choose "C++ Project". A dialog box will ask whether to open the C/C++ perspective. Answer "yes", and remember this decision.


1 Answers

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.

like image 134
Ioan Avatar answered Sep 19 '22 04:09

Ioan