I got "cannot open source file" even if I walk thurough a tutorial.

edom18 21 Reputation points
2021-06-08T23:58:25.68+00:00

Hi, I'm new to creating Visual Studio project.

I've tried below tutorial. I'm now creating DLL sample. But I got the error I mentioned at title when I try the tutorial.
https://learn.microsoft.com/en-us/cpp/build/walkthrough-creating-and-using-a-dynamic-link-library-cpp?view=msvc-160

Firstly, I created a MathLibrary project that is from the tutorial, then I created a client project too. But I got the error on the client project even if I added a include directory reference in a property setting.

mathclient-additional-include-directories-property.png

103613-error-sample.png

Why I got the error?

Developer technologies | C++
0 comments No comments
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2021-06-09T02:09:13.46+00:00

    Hi,

    I suggest you check if the platform is set to x64.

    103623-image.png

    And I suggest you could select "All Platforms" for the platform and select "All Configurations" for the Configuration when changing the properties.

    103691-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.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. RLWA32 49,536 Reputation points
    2021-06-09T00:21:17.483+00:00

    You say that you added the path to the dll header files in the project properties for additional include directories. However, you don't show the entry you made and we do not know the correct paths for the dll headers relative to the file system location of the client project.

    So, my best guess is that you entered the wrong path in the project property for additional include directories. If you provide more information we may be able to suggest a specific solution for you.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.