Adding C/C++ libraries for custom C/C++ projects in CDT. [message #893637] |
Thu, 05 July 2012 04:02 |
|
Hello everyone,
I have created a plug-in based on MBS design for C/C++ project.
I am facing problem in adding custom libraries while creating the project in code.
to include libraries from the code, I am using "setRawPathEntries" in overridden methode createIProject to add it for C Project. it is working fine. but it is not working when i use Eclipse Juno with CDT 8.1. I want to include external libraries ( which are not local C/C++ libraries like cygwin gcc installed in the machine) for my project same like it comes for CDT's default C/C++ project after creating the project if gcc is installed in the system.
Is there any other way to add the include libraries from the code ? I didn't find other methods to include the libraries for C/C++ project.
|
|
|
|
Re: Adding C/C++ libraries for custom C/C++ projects in CDT. [message #896614 is a reply to message #894234] |
Thu, 19 July 2012 07:24 |
|
For my custom tool chain, I have implemented same tool option as gcc compiler contains in Tool Setting page under C/C++ project property page. like Warning, Devug level, Includes, General etc.
so for my tool chain if i add any library from Include option of my custom compiler and click on Apply and OK. i can see the the newly added include link in project explorer for the project in "Includes". It worked in helios in indigo. but it is not working in Juno.
i am facing this problem only with my tool chain. default CDT's tool chain for gcc , g++ compiler doesn't have any problem.
Here is the some part of the code which i have used to add an external library location as include library. the same was working fine with eclipse helios and indigo. but it is not working with Juno. code mentioned below is just for reference just to understand what i am doing to add the libraries for custom C/C++ project.
1. Extending CDT's wizard class with custom wizard- CustomProjectWizard extends CDTCommonProjectWizard.
2. overriding createIProject, creating a project as -
newProject = CCorePlugin.getDefault().createCDTProject(description,
newProjectHandle, new SubProgressMonitor(monitor, 25));
private ICProject cProject;
cProject = CoreModel.getDefault().create(newProject);
private List<IIncludeEntry> newEntries;
newEntries.add(CoreModel.newIncludeEntry(newProject.getFullPath(), null,
new Path(strLink), true));
cProject.setRawPathEntries(newEntries.toArray(new IPathEntry[newEntries.size()]),
null);
Thanks,
Vishu.
|
|
|
Powered by
FUDForum. Page generated in 0.03202 seconds