Cannot open source file in visual studio 2015

21,718

Solution 1

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.

Solution 2

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.

Share:
21,718
cmacia06
Author by

cmacia06

Student at the University of Texas at El Paso (UTEP). Studying Electrical Engineering. Can program in C.

Updated on November 02, 2020

Comments

  • cmacia06
    cmacia06 over 3 years

    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.

    cannot open source file

    These are my settings.

    Directories

    Libraries

    enter image description here

    For the path, I have tried with and without the trailing forward slash.