Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse cdt add multiple libraries

Is there any way to add multiple libraries or only one by one in C/C++ Build --> Settings --> MinGW C++ Linker --> Libraries (-l) ?

What I mean is there a way just to copy from somewhere (some txt file for example) all of the names of libraries and then to paste them into the Libraries (-l) field, the same way it could be done in Visual Studio 2010?

enter image description here

Also, where does eclipse stores information about this? I have to rename a lot of libraries (from opencv245 to opencv246) so I guess if it is stored in some XML file I could just run search and replace tool on it's content.

like image 431
Nenad Bulatović Avatar asked Jul 31 '26 14:07

Nenad Bulatović


1 Answers

I'm using Eclipse (Kepler) with CDT on CentOS and it appears that my project libraries (-l) and library paths (-L) are in the .cproject XML file located in the project directory. There is a lot in there but you should be able to find it under the appropriate tool XML entry. (I'm using Linux GCC.) Here's mine:

<tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.429094553" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug">
  <option id="gnu.cpp.link.option.libs.2011755342" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
    <listOptionValue builtIn="false" value="common"/>
    <listOptionValue builtIn="false" value="customapi"/>
  </option>
  <option id="gnu.cpp.link.option.paths.1035898902" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
    <listOptionValue builtIn="false" value="&quot;${workspace_loc:/common/Debug}&quot;"/>
    <listOptionValue builtIn="false" value="&quot;${workspace_loc:/customapi/Debug}&quot;"/>
  </option>
  <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.198247885" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
    <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
    <additionalInput kind="additionalinput" paths="$(LIBS)"/>
  </inputType>
</tool>
like image 92
jkwinn26 Avatar answered Aug 07 '26 04:08

jkwinn26



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!