Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Getting translation unit from a CDT Project
Getting translation unit from a CDT Project [message #1769693] Wed, 02 August 2017 17:23 Go to next message
Hamiz Ahmed is currently offline Hamiz AhmedFriend
Messages: 2
Registered: August 2017
Junior Member
Hi,
Can someone tell me how to get ITranslationUnit from an ICproject?
The project contain multiple C files and is indexed. However, I am just unable to get the translation unit for the files in the project.
Here is the code I am using

IPath filePath = new Path("\\Test Project 10\\src\\Arrays.c");
ICElement element = icdtProject.findElement(filePath);
ITranslationUnit unit = (ITranslationUnit)element;

This throws exception in line 2. However, Arrays.c is one of the file in the project. I will be extremely thankful if someone helps in this case.

[Updated on: Thu, 03 August 2017 08:10]

Report message to a moderator

Re: Getting translation unit from a CDT Project [message #1769791 is a reply to message #1769693] Thu, 03 August 2017 12:12 Go to previous messageGo to next message
Jonah Graham is currently offline Jonah GrahamFriend
Messages: 397
Registered: June 2014
Senior Member
I have a better place to ask questions like this, the cdt-dev mailing list:

Quote:
questions regarding CDT guts and extending CDT should be asked on
cdt-dev mailing list, it is intention on this list


https://dev.eclipse.org/mhonarc/lists/cdt-dev/msg32224.html

Sign-up here https://dev.eclipse.org/mailman/listinfo/cdt-dev
Re: Getting translation unit from a CDT Project [message #1769800 is a reply to message #1769791] Thu, 03 August 2017 13:40 Go to previous message
Hamiz Ahmed is currently offline Hamiz AhmedFriend
Messages: 2
Registered: August 2017
Junior Member
Thanks
Previous Topic:Plugin is showing up blank
Next Topic:Adding external static library to C project
Goto Forum:
  


Current Time: Mon Dec 11 13:12:21 GMT 2017

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

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