question

MalteEkman-8925 avatar image
0 Votes"
MalteEkman-8925 asked JeanineZhang-MSFT commented

Error "Cannot open source file" in c++

So I am new in c++ and in visual studio, every time i try and build/debug, it always fails and basically all the files in "External Dependencies" comes up in the error list saying it cannot be opened.
I have checked the forum but nothing is explained clearly enough for me to understand, i have added the include folder to the additional include directories but nothing is working.
can someone help me?

c++
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If you have a similar problem after following the Create a C++ console app project page (as above) then the problem is probably caused by something you did and if so then we need more information.

0 Votes 0 ·

Were you able to compile and run the default project that was created by Visual Studio?

0 Votes 0 ·

1 Answer

JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered JeanineZhang-MSFT commented

A:

I suggest you should check your project settings, under C++, check include directories and make sure it points to where .h file. And I suggest you should use absolute path.

And I suggest you should check if the platform and configuration settings are consistent with the build time.

127715-image.png

127648-image.png

I suggest you could set them to ALL.

127747-image.png

Best Regards,

Jeanine


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (8.8 KiB)
image.png (1.2 KiB)
image.png (7.2 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MalteEkman-8925

May I know if you have got any chance to check my answer? I am glad to help if you have any other questions.

0 Votes 0 ·