简体   繁体   English

无法在visual studio 2015中打开源文件

[英]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. 我正在尝试使用Visual Studio Community 2015在Windows中编译本教程的 OBS工作室 。我在visual studio中创建了一个项目,并通过将文件拖到解决方案资源管理器中将整个git repo复制到项目中。 This project has dependencies on libav, x264, and curl. 该项目依赖于libav,x264和curl。 They are given as .lib, .dll, and header files. 它们以.lib,.dll和头文件的形式给出。

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). 我把头文件放在dll和lib的单独文件夹中(dll和lib在同一个文件夹中)。 Under the project settings->VC++ Directories I added the include directory, and also added the library directory. 在项目设置 - > VC ++目录下,我添加了include目录,并添加了库目录。 Then I added the lib's specifically under Linker->input->additional Dependencies. 然后我在Linker-> input-> additional Dependencies下专门添加了lib。 Then I added the directory that contains the .dll files to the environment variable PATH. 然后我将包含.dll文件的目录添加到环境变量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. 这是一个有问题的源文件的屏幕截图。

无法打开源文件

These are my settings. 这些是我的设置。

目录

图书馆

在此输入图像描述

For the path, I have tried with and without the trailing forward slash. 对于这条路,我尝试过使用和不使用正斜杠。

EDIT: Use the C/C++ settings instead of VC++ settings for additional include directories. 编辑:使用C / C ++设置而不是VC ++设置用于其他包含目录。

What is probably holding you up is that those folder icons in the VS sidebar are not actually related to the file system. 可能阻碍你的是,VS侧栏中的那些文件夹图标实际上与文件系统无关。 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. 这是对Drop的建议的另一种解释 - 检查文件是否真的在你认为的位置。

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. 在Project Properties中将配置从x86切换到x64 ,错误消失了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM