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.
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
I am having an issue including files outside my project directory. I have a project in eclipse with some header files outside of the project that need to be linked to my project. I have added the path to C/C++ General for the header files and included them in my code. It seems like only one of the files can be seen and the other file I am getting an unresolved inclusion error. Does anyone know how to fix this?
The following is thanks to comments from #user7860670 -- you can see more commentary in eclipse: including a path outside of the project
Short form:
Use system variables.
For include directories relative to your workspace, use something of the form "${workspace_loc}/../my_includes".
For include directories relative to your project, use something of the form "${project_loc}/../my_includes".
Note that in some IDEs, the system variables may be named differently.
See eclipse: including a path outside of the project for more details.
This was an issue we've been dealing with for a while now - we're building a C++ project using the Cygwin toolchain, and no matter what we add in the C++ compiler include paths under project settings, Eclipse can't seem to find the necessary header files.
We have done everything the Stackoverflow community has suggested so far;
Made sure include paths were workspace-relative
Tried backslashes and forward slashes
Tried using Cygwin-specific paths (/cygdrive/c instead of C:/)
Checked the compiler output to verify include paths are there
Checked the generated makefiles to make sure they're correct
Rebuilt the index
Deleted the debug folder entirely
restarted Eclipse
Basically nothing short of changing the #include <...> code itself to use a full path (C:/.../file.h) worked. This doesn't work for our needs as we need multiple developers to be able to work on this project, and the files themselves are generated dynamically as a result of some of our build procedures.
So here's a fun little detail about Eclipse we didn't know - specific source files themselves can have their own settings.
If you look at your source files and see the following wrench icon, this means that file has some settings which may be contrary to your project-specific settings.
As a result, our source-specific settings were overriding the include paths, so for those files, none of the headers could be found. The best part is that Eclipse doesn't tell you in any way more explicit than this - the wrench icon does not offer a tool-tip to explain what's going on.
Simply right click on the file > go to Resource Configurations > Reset to Default...
Your header files will be found now, provided that you've written the correct include paths in your project settings.
For reference, we're using Eclipse Kepler - I'm not sure if they fixed this and added more info for users in newer versions.
I'm starting with a new Win32 console app project in Visual Studio 2010. I am setting up my environment to support beginner level OpenGL programs. I am in the process of adding required *.cpp files and *.h files. I added
#include "../../shared/gltools.h"//opengl toolkit
Error "cannot open source file" is displayed when I hover over #include. I attempted to add the required file. I right click Source files and choose > Add > New Filter > called it shared and hit enter.
What is a filter? I thought I would be adding a physical folder rather than a filter. How does this differ from "External Dependencies"?
In the project properties, unde Compiler, find the field Additional Include Directories and add the directory where the file is located, or, alternatively, the directory where /shared/ is located.
find and analyse some of the OpenGL samples, these are most often with OpenGL headers and libraries which clearly you have. Check which include directory you are using - configure that as 'Luchian Grigore' above described. When you have that working (program compiles) remember to add library directories (in project settings, linker options) or there will be linker problems. This all should be described in howto or code samples. Analyse them to get started. Don't reinvert the wheel and have fun.
for example I need to include a header
#include <OpenGL/glext.h>
while it is actually a header file glext.h under OpenGL.framework/Headers/.
Therefore it is no way to give eclipse a physical path about "OpenGL/glext.h", and I always get unresolved inclusion warning.
I can still build and run them (with managed makefile project) but it is impossible to browse the functions or definitions from those "resolved" header files.
is there any solution?
While not ideal, my solution to this has been to create a folder "/Developer/Framework Headers" (though the name isn't important), and link from e.g. "/System/Library/Frameworks/Foo.framework/Headers" to "Foo" under said folder. Then in Eclipse I add "/Developer/Framework Headers" to a project's includes.
I say not ideal because apart from having to create links for the frameworks you need and add an include to each project, Eclipse seems to have trouble in certain cases such as nested frameworks (e.g. CoreGraphics beneath ApplicationServices), but YMMV.
Yes there is one. Right click on the project in "Project Explore" window and click on the "property". In there Open "C/C++ General" column and choose "Path and symbols". Now you see all of the include library path for this project. If your using C then add the OpenGL library into GNU C, or if you use C++ then add it into GNU C++. Unfortunately you have to do this for every new project. I have been searching for a while how to do this by default but nothing really useful. Hope this help you get rid of those annoying yellow wave lines.
Since current Eclipse CDT releases don't perform sub-framework header inclusion correctly, you can avoid sub-framework problems (like those generated by the CoreServices header files) by creating symbolic links to the include directories of each sub-framework. I elaborated on this subject, which stems from danhan answer on this question, in this blog post.
In order to automate this process, I've created a Z shell script which automates this process and creates the symlink to the specified frameworks' header directory, together with the links to the include directory of each one of their sub-frameworks. The script can be found in this GitHub repository.
Hope this helps.
So I'm playing around with an ActionScript library (Flare, to be specific) in Flex Builder 3. I'd like to have this functionality available to all projects in my workspace without having to copy it to every one. What's the easiest way to do this?
I'm not sure this is the best way, but you can link to a folder or file from within a project. You right-click on the project, and choose "New <whatever>" and click on the Advanced button to access the link functionality. From there, you can use the file navigator to choose a file or folder. Afterwards it will show up in the project properties under the build path (the tab for library paths).
We use this because we split off a large chunk of our code into a separate library project, but that code still references a ton of image files in the original projects root directory. So we create a link to that image directory and all is well again. Maybe this will help you also.
We have a shared folder "flex" that we place our common libs. In the properties for the project, under flex build path, set the library path to your location for flare.