Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » how to add library and library path programmatically
how to add library and library path programmatically [message #1143426] Fri, 18 October 2013 07:15
Henrik Rentz-Reichert is currently offline Henrik Rentz-ReichertFriend
Messages: 242
Registered: July 2009
Senior Member

I achieved to add include paths to a C project description along the lines

ICProjectDescription projectDescription = CoreModel.getDefault().getProjectDescription(project, true);
ICConfigurationDescription configDecriptions[] = projectDescription.getConfigurations();
for (ICConfigurationDescription configDescription : configDecriptions) {
ICFolderDescription projectRoot = configDescription.getRootFolderDescription();
ICLanguageSetting[] settings = projectRoot.getLanguageSettings();
for (ICLanguageSetting setting : settings) {
if (!"org.eclipse.cdt.core.gcc".equals(setting.getLanguageId())) {
List<ICLanguageSettingEntry> includes = new ArrayList<ICLanguageSettingEntry>();
includes.add(new CIncludePathEntry(src_gen, ICSettingEntry.LOCAL));
setting.setSettingEntries(ICSettingEntry.INCLUDE_PATH, includes);
try {
CoreModel.getDefault().setProjectDescription(project, projectDescription);
} catch (CoreException e) {

But when I do that in a similar way for libraries and library paths

List<ICLanguageSettingEntry> libPaths = new ArrayList<ICLanguageSettingEntry>();
libPaths.add(new CLibraryPathEntry(mingw_debug, ICSettingEntry.LOCAL));
setting.setSettingEntries(ICSettingEntry.LIBRARY_PATH, libPaths);

then I realize that the settings aren't stored because the kind isn't supported by the store.

Where do I have to store library paths and library files?

Previous Topic:Code works in Qt Creator but not in eclipse
Next Topic:synchronization error for project
Goto Forum:

Current Time: Sun May 20 18:02:37 GMT 2018

Powered by FUDForum. Page generated in 0.01989 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top