3
votes

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.

2
Make sure you are changing project setting for the same configuration as you build. I see Debug/Win32 and Debug/x86. Not sure if those the same. Check that include folder contain folder that is before / in the #include clause and this folder contain a file that you include. Physically. I mean go there and see if those exist.Ivan Aksamentov - Drop

2 Answers

7
votes

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.

3
votes

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.