Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Exception thrown while using C/C++ Indexer

Hi Beth

To add entries to list of Includes, I'm using following snippet


		IPath newPath = getLocationPath();
    		String linkDirPath = newPath.toString() + "/" +
REMOTE_LINK_DIR;
    		
    		String[] argLinks = new String[] {
    				linkDirPath + "/usrIncludeLink",
"/usr/include", 
    				linkDirPath + "/usrLink", "/usr",
    				linkDirPath + "/aCCIncludeIostreamLink",
"/opt/aCC/include_std/iostream_compat"
			};
    		AddLinks(newProject, argLinks);
    	
    		
	    	ICProject cProject =
CoreModel.getDefault().create(newProject);
	        
	        
	        List newEntries = new ArrayList(argLinks.length/2);
	        
	        
	        for(int cnt = 0; cnt < (argLinks.length/2); cnt++)
	        {
	        	
	     	    newEntries.add(CoreModel.newIncludeEntry(Path.EMPTY,
Path.EMPTY, new Path(argLinks[(2*cnt)]), true));
	     	   	   
	        }
	        	
	
cProject.setRawPathEntries((IPathEntry[])newEntries.toArray(new
IPathEntry[newEntries.size()]),
	     		   null);


In the above code, AddLinks simply creates links to remote include
directories.

Hope this helps.


Rgds
Virender.
			 

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Beth Tibbitts
Sent: Tuesday, July 18, 2006 5:40 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] Exception thrown while using C/C++ Indexer

>I'm adding some default directories to the list of Includes for the 
>projects.
Kumar, can you post how you did this? I did a similar thing but had to
enumerate through all the configuration and options, and poke around...
For now it's hardcoded to the gnu gcc option too...
 - seems like from your discussion and Mikhail's suggestion you found a
more direct way.
I'm still not happy with how I did it, want to generalize it a bit more.
Thanks.

...Beth

Beth Tibbitts  (859) 243-4981  (TL 545-4981) High Productivity Tools /
Parallel Tools  http://eclipse.org/ptp IBM T.J.Watson Research Center
Mailing Address:  IBM Corp., 455 Park Place, Lexington, KY 40511

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top