Eclipse can't resolve <includes> despite seeing them in project's Includes - eclipse-cdt

I have a C project opened in Eclipse that uses a third party library. I added a /usr/local/include/ and /usr/include/ to the project's includes and the Project explorer window shows all required header files correctly.
The build also works fine but the Editor part of the ide doesn't seem to be able to resolve #include pointing to the 3rd party header files correctly.
I've tried restarting Eclpse and rebuilding the index. I've also tried both default settings and Enable project specific settings for indexer, nothing work. Individual source files don't have specific configuration.

Copying the header files to ~/devheaders and pointing Eclipse there solved the issue, no idea why. Permissions on the header files were fine.

Related

vscode intellisense can't find header files included in cmake project

I have a cmake project that has:
A static library called Project1
A static library called Project2 that depends on Project1
An executable called Project3 that depends on both libraries
Everything is working as expected (makefiles, it is building and running normally, ...),
but the problem is that vscode intellisense just does not find the header files in the
folders specified using target_include_directories on each subdirectory.
The intellisense can find the default headers (iostream, vector, etc).
example: https://i.stack.imgur.com/XeVGW.jpg
I also tried putting the include directories in c_cpp_properties.json:
"includePath": [
"${workspaceFolder}/Project1/src/**",
"${workspaceFolder}/Project2/src/**",
"${workspaceFolder}/Project3/src/**"
]
But it also didn't work.
I also tried putting the headers/sources manually in all CMakeLists.txt files (without using file(GLOB_RECURSE))
But it also didn't work.
This project is just a small example I made to show the problem, but it also happens in all the other projects.
The project can be found here: https://github.com/gabrielmaia2/CmakeTest
Found it. The extension "C/C++ Clang Command Adapter" was showing the errors because clang was not configured. I just disabled it (since I'm not using it) and now its working as expected.
For those of you who are still experiencing this very irritating issue, the solution that worked for me was to just disable any C++ extensions, i.e. the Microsoft C++ extension pack, then enable them again.

Eclipse can't find header file, even though include paths are set

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.

Cannot open source file in visual studio 2015

I am trying to compile OBS studio with this tutorial in windows using Visual Studio Community 2015. I have created a project in visual studio and copied the entire git repo into the project by dragging the files into the solution explorer. This project has dependencies on libav, x264, and curl. They are given as .lib, .dll, and header files.
The problem is I keep getting "cannot open source file". I have the the header files in a separate folder from the dll's and lib's (dll and lib are in the same folder). Under the project settings->VC++ Directories I added the include directory, and also added the library directory. Then I added the lib's specifically under Linker->input->additional Dependencies. Then I added the directory that contains the .dll files to the environment variable PATH.
After all this, I still keep getting the same error, as well as a few other errors. Here is a screen shot of one source file that has the issue.
These are my settings.
For the path, I have tried with and without the trailing forward slash.
EDIT:
Use the C/C++ settings instead of VC++ settings for additional include directories.
What is probably holding you up is that those folder icons in the VS sidebar are not actually related to the file system. They are filters and don't change depending on the actual directory.
This is another explanation for Drop's suggestion -- check to see if the files are really where you think they are.
In my case I already added the include libraries but that was not enough. The error went away once I switched the configuration from x86 to x64 in Project Properties.

Visual C++ project can't find 'xyz.h' file for external dependencies

I have a Visual Studio C+++ project, and in the project I have some header files I want to get via the include directories setting on the project properties.
As far as I know that's all set up correctly. I've added the folder path which contains the files and the 3 files appear in the external dependencies folder under my project in Visual Studio.
The problem is that:
when I write the include "xyz.h" for one of the three files, I get "can not find file blah blah" error. This only occurs for one of the three. The other two work fine and I can include them just fine. They are all just basic headers.
Does anyone have any idea why one of my files would fail to work. Thanks
When you setting up the project properties such ad additional include directories, make sure to select "All configurations" in the project properties window. look at the image.
Sorry, the problem was that the file was being used by some background process, so the dll that I was trying to load couldn't open the file.

cannot locate the .lib file VS12 is trying to open

So I am creating an app in VS2012 in MFC using an old Microsoft SDK (called VisSDK for machine vision) which worked fine with VS6. The problem is, I get this LNK1104 error, Cannot open file VisImSrcLibDB.lib.
I have done a search through the project for VisImSrcLibDB...but nothing came up. I have checked all the header files (external) and tried to see where is this being called.
I can presume (based on the name) that it seems to be part of the SDK, but cannot for the love of god figure out where is this being called from.
Any Help would be appreciated in this. Here is a screenshot:
PS: yes I have mapped the lib folder of the SDK under LINKER properties. and the corresponding include folder in the Additional Include directory.
If you haven't already, you should turn on the VS flags for verbose output. That should give some indication as to why things are being pulled into the build.
The VisImSrcLibDB.lib must exist some where in your VisSDK directory.
Use the PROJECT-Properties command, All configurations from the Configuration drop down list and add the directory containing the VisImSrcLibDB.lib file to the Library Directories in the VC++ Directories section.