Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open source file in visual studio 2015

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.

like image 707
cmacia06 Avatar asked Aug 27 '26 03:08

cmacia06


2 Answers

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.

like image 140
Nathan J Avatar answered Aug 29 '26 17:08

Nathan J


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.

like image 22
isapir Avatar answered Aug 29 '26 19:08

isapir



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!