"Error C1083: I can not open the include file", but I have a path to the include file

In connection with this question , I included the header file in the code for the console application, which I use to test the DLL, but Visual Studio returns the following error:

error C1083: Cannot open include file: 'myProject.h': No such file or directory 

But I included the folder path for myProject.h in the additional Include directories. I also tried entering it in Configuration Properties -> Debugging-> Environment as the value "PATH = <...>". Path: U:\Software Development\c++ projects\myProject\myProject , and when I go to this folder, I can see myProject.h in the folder.

 #include "stdafx.h" #include <iostream> #include "myProject.h" using namespace std; int main() { cout << myProject::FileOperator::openDoc(1799,29); } 

When I type "#include", Intellisense shows me only 3 items: the Debug folder corresponding to U:\Software Development\c++ projects\myProject\myProject\Debug , stdafx.h and targetver.h .

+6
source share
1 answer

Possible Solution 1:

 #include "../myProject.h" 

Possible Solution 2:

Project Properties ~> C / C ++ ~> General ~> Additional Include Directories, try setting the path there relative to the directory where your .sln file (solution) is located. If the solution is in U:\Software Development\c++ projects\myProject\ , try setting it to $(SolutionDir)myProject

+5
source

Source: https://habr.com/ru/post/955818/


All Articles