Why are my C++WinRT includes not working? - c++

So I recently tried to set up the environment to develop UWP apps, and installed VS community 2019 16.5.3
Here are my selected components:
UWP development workload and Desktop development with C++
I also installed the VSIX extension from the VS market place.
When I create a new Windows Console App(C++WinRT) this is my main and you can see the error list
I already tried uninstalling and reinstalling VS 2019. I have the proper Windows 10 SDK version + I also enabled developer mode in Windows settings. Im on Windows 10 1909 build 18363.720
The includes are in 'pch.h' by default.
Thank you.

Related

Why do I get "Illegal Instruction" error when Building on windows10 and running on Windows7

I have a c++ program built using VS2017 on windows7.
When I run it on Windows7 or windows10 there is no problem.
If I Build the same program on Windows10 (still using VS2017) the program runs OK on Windows10 but when I try to run it on Windows7 I get an "0xC000001D: Illegal Instruction." error.
Is it even possible to run programs built in Windows10 on Windows7 ? and if so what can I do?
Thanks
The default SDKs will be different on your two VS2017 installations. Right-click the project, select "properties", then the "General" page. See Windows SDK Version.
You can install different SDK versions (and different Platform Toolsets) using the Visual Studio installer ("Modify").
You would probably need to install the v140 toolset.
Also see the response here:
https://social.msdn.microsoft.com/Forums/vstudio/en-US/e19634d8-f635-4ed0-b8d7-45b64ccbd6fa/windows-sdk-7-in-visual-studio-2017?forum=visualstudiogeneral
...which states:
You can create a project with the default project template. After that, right click the project name under Solution Explorer and go to Configuration Properties-General, modify the 'Platform Toolset' to Windows7.1SDK, since you already installed the Windows SDK 7. Please have a look at the following note:
##To change the target platform toolset, you must have the associated version of Visual Studio or the Windows Platform SDK installed. For example, to target the Itanium platform with the Windows7.1SDK platform toolset, you must have Microsoft Windows SDK for Windows 7 and .NET Framework 4 SP1 installed
If the above not works, you can also modify the platform toolset to Visual Studio 2010 (v100), which has the same compiler like Windows SDK 7, if you have the VS 2010 and VS 2017 on the same computer

update to UAP (10.0.16299.0)

Currently I am using VS2017 Community.
I have downloaded the Windows IoT template for VS2017 community to do UWP programming.
After created the project, when I try to open the XAML file in designer view, I encountered this Message:
visual studio requires a newer version of windows to display this content.
please update to windows 10 Fall Creator update(10.0.16299.0)
So, I downloaded latest Win10 SDK
But Now I have this message:
visual studio requires a newer version of windows to display this content.
please update to UAP (10.0.16299.0)
What I need to do?
Thanks
You need the VS 2017 (15.4 update) or later to get the Windows 10 Fall Creators Update SDK (16299) integration.
If you have the 15.4 update already, then run the Visual Studio Installer, go to the Individual Component tab, and then check the components for 16299. Hit Modify.
See this blog post.
UPDATE: For C#/C++ projects, you set which Windows 10 SDK is used by editing the Project Properties and setting the Target Platform Version to 10.0.16299.0. You can also use the "Retarget solution" or "Retarget project" option.

"LNK1104 Cannot open file 'kernel32.lib' " when Windows SDK version is set to 15063.13

I'm doing C++ in Visual Studio 2017, and just recently updated Windows 10 from Anniversary Update to Creator's Update.
I found out by accident that when I'm compiling a DLL project, I would get the error message:
LNK1104 - cannot open file 'kernel32.lib'
After twiddling a bit in the Project Properties, I noticed if the Windows SDK version is set from 10.0.14393.0 to 10.0.15063.0, the error message appears. If I set it back to 10.0.14393.0, I can compile just fine.
I would like to know why when the Windows SDK version is set to the Creator's Update build version, it's throwing this error message, yet it doesn't if set back to the Anniversary Update's build version?
Thanks.
https://developercommunity.visualstudio.com/content/problem/41913/link-fatal-error-lnk1104-in-empty-c-project.html
The Windows 10 Creators Update SDK made some significant changes to
what is installed as part of the installation to minimize on-disk
footprint. This is a Known Issue that results from that refactoring
work where the "desktop" components of the Creators Update SDK do not
get installed by default. The previous new project logic always
selected the latest Windows 10 SDK, assuming the desktop portions were
installed as part of that installation scenario. We are working on a
fix for a future update.
The workarounds available are as follows:
Select a version of the Windows 10 SDK that's fully installed on the system (i.e. 10.0.14393.0 or earlier) in the Project Properties
Install the 'Windows 10 SDK (10.0.15063.0) for Desktop' component via the Visual Studio Installer. win10sdk-15063desktop.png
Daniel Griffing,
Visual C++ Libraries
I have the same problem, honestly, looks like a bug in VS 2017. Just switch to 10.0.10586.0.

Visual Studio for Windows Media Foundation

I am going to build sample application using Windows Media Function, but I am confused with Visual Studio version that need to be used. Also how I can start with this sample application. Do I need to download Windows Developer SDK for building this sample? Also what tools I need to use to build UI components.
I want to build sample application for playing local video file.
To develop classic/desktop applications using Media Foundation API it is sufficient to use simplest edition of Visual Studio, e.g. Visual Studio 2015 Community Edition along with Windows 10 SDK (do not get confused by "Windows 10" in the title, appropriately built applications can run in Windows XP and more recent). You will have to look up desktop application samples in older Windows SDK versions up to version 7.1, since version 8 they were omitted (later they were put online here). At the same time, there are also newer Media Foundation samples available in the format of Windows 10 UWP applications, you can built them with the mentioned toolset as well.

VS 2017 RC missing Windows 10 Mobile Emulator

I installed Visual Studio 2017 RC, and in general I'm really impressed! One problem, however, is that I can't figure out the proper method of installing the Windows 10 Mobile Emulator. I have installed the Windows 10 SDK as well as the Emulator itself. My Programs and Features clearly shows these two items are installed:
. Windows 10 for Mobile Image - 10.0.14393.0
. Windows Software Development Kit - Windows 10.0.14393.33
I also have properly selected the Cordova tools during the installation of VS 2017 RC. I can create a new JavaScript project using Cordova and it looks to be correct in the Solution Explorer.
But when I launch Visual Studio 2017 RC and then inspect the Solution Platforms dropdown, it only has these options:
Android
iOS
Windows-ARM
Windows-x64
Windows-x86
Configuration Manager...
I do not see any option for Windows 10 Mobile.
What am I missing?
Nevermind.... Somehow I installed more stuff and then found what I am looking for by selecting Windows-X86, and then there are options for Mobile Emulator 10.0.14393.0 in various memory and screen configurations. Just keep clicking things until it works, I suppose... Seriously, probably my own fault. Moving on!