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-Reichert
Messages: 220
Registered: July 2009
Senior Member
Hi,

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())) {
continue;
}
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) {
e.printStackTrace();
}

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?

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


Current Time: Fri Oct 31 06:25:19 GMT 2014

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

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