Eclipse C++ in Clearcase vobs: Unresolved inclusion

Viewed 55

I would like to get your thoughts on why I am getting an "unresolved inclusion" error for certain .h files included as part of my project.

I actually cloned the project from another existing project, by simply copying, pasting and renaming.
Inside the cloned project, which originally had only a src/ directory, I also created a tst/ directory and did right-click->New->Folder and from the menu, clicked on Advanced >> and selected "Link to alternate location (Linked Folder)" and browsed to the relevant path under /vobs to add the source folder to my project.

Once I did this, the indexer started rebuilding the index, at the end of which I got the above mentioned inclusion errors.

The .h files could be located inside a specific folder path under /vobs; I first tried including this path by right-clicking on the cloned project and choosing Properties->Paths and Symbols->Includes to update the include list with the folder path. This didn't resolve the error.

Subsequently, I tried repeating the above procedure for the newly created tst/ directory from within the project; that didn't resolve the error either.

Not sure what is it that I am missing here.
Any suggestions would be appreciated.

2 Answers

Check first if those files are there, in your view. '/vob' could mean dynamic view, mounted under /vob.

I would rather work with a snashot view, which would download those same files on disk (rather than using the MVFS, Multi-Version FileSystem of a dynamic view).

Then, when you are sure the files are there, and cleartool ls shows them correctly loaded, you can double-check your inclusion paths, as mentioned here

"unresolved inclusion" means the file can't be found.
This means the directory containing it hasn't been specified to CDT or it has been misspelled.

If spelled correctly, normally you would specify the path with Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc. on the Entries tab as a user entry.

Note that it depends on the type of project.
When you select File --> New -> C/C++ Project you are presented with various options. The options are for the kind of builder used. Some, such as Meson, Qt , Arduino and maybe others don't have the option "Preprocessor" option.

My guess is that you are not set in a view when you start Eclipse. This will prevent resolution of the the absolute "/vobs/..." paths. If you start Eclipse from GNOME (or any other windowed environment) the current working directory of Eclipse is likely your home directory. Without a view context, the /vobs/... paths will not contain any files under source control.

You COULD use /view/myview/vobs/myvob/... in the include paths, but that would mean EVERYONE who would use the project would have to either start your view or create and start an identically named one... And that's just the start of that particular can of worms.

You may want to confirm how Eclipse handles relative paths in the include path. Do they start from the current working directory of Eclipse? The project home directory? Somewhere else? That may give you a safe view-independent way to specify your include paths.

I would try setting a view and starting Eclipse from within the subshell spawned by cleartool setview. Then verify whether the includes are accessible.

Related