2016-09-20 115 views
1

您好,非常感謝您的幫助。 我最近用C++下載了一些源文件。他們構建了一個用於管理攝像頭的DLL。 無論如何,當使用Visual Studio 2015打開時,它會通知我將會有一些轉換,因爲編譯器已更改。 此後有紅線下無法打開源文件「windows.h」「WTypes.h」

#include <windows.h> 
#include <WType.h> 

通過鼠標在他們它說:「無法打開源文件...」

現在,我已經用Google搜索這個錯誤,並發現了一些資源,即使在這種非常相同的網站。 但是他們的解決方案不起作用。有時OP會說「哦,它工作得很好!」但沒有說明是什麼使其工作。

所以我在這裏尋求幫助。什麼是這個錯誤,我該如何解決它? (我假設它涉及項目的一些設置)再次

感謝所有幫助

(PS我有作家提供的dll文件,但想建項目我自己)

編輯: 構建輸出消息當是

1>------ Build started: Project: DirectShowFacade, Configuration: Debug Win32 ------ 
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140_xp\Toolset.targets(36,5): warning MSB8003: Could not find WindowsSdkDir_71A variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. 
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. 
1> DirectShowFacade.cpp 
1>d:\xxxxxxxxxxxxxxxx\cameraprogramming\directshowfacadesources\directshowfacade.h(28): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory 
+0

「配置屬性 - >常規 - >平臺工具集」的確切值是什麼?嘗試將其更改爲「Visual Studio 2015 - Windows XP」 –

+0

感謝您的回覆。已經做了。仍然存在錯誤。 – KansaiRobot

+0

你的visual studio可以編譯一個簡單的cpp文件嗎?如果沒有,那麼可能是配置不正確(或者你可能需要安裝SDK,但windows.h應該與編譯器一起出現,我會想象......我想知道當你導入的項目有一些不好的路徑時或者其他)請參閱http://stackoverflow.com/questions/12748896/cannot-open-windows-h?rq=1 – rogerdpack

回答

2

屬性→常規→目標平臺版本→更改爲8.1

+0

礦是10而不是8.1,但這對我有效。 – user1132959