I have a project that installs and runs on windows 10 machines but on windows 7 when I try to run it a notification pops up that says there are missing .dll files. I believe visual studio needs to be targeting windows 7 for it to run on windows 7. When I go to the property pages in visual studio, the "Target Platform" field says "Windows 10" and can't be changed. How do I change the target platform?
The "Target Platform Version" field in the Visual C++ project properties only picks which Windows SDK to build against. For Win32 desktop apps, if you want to build against a 'down-level' version of Windows like Windows 7, you need to set the _WIN32_WINNT preprocessor symbol to the appropriate value.
#include <WinSDKVer.h>
#define _WIN32_WINNT 0x0601
#include <SDKDDKVer.h>
See Using the Windows Headers for details.
The Windows 8.1 SDK, the Windows 10 SDK (10240), Windows 10 SDK (10586), Windows 10 SDK (14393), and Windows 10 SDK (15063) can be used to build Windows Win32 desktop apps for Windows Vista SP2, Windows 7 SP1, Windows 8.1, and Windows 10.
Keep in mind that the VS 2015 / VS 2017 C/C++ Runtime supports Windows 7 Service Pack 1, but does not support Windows 7 RTM. Windows 8.0 is not officially support either as users are expected to have upgraded to Windows 8.1 or Windows 10 by this point.
Note that building for Windows XP Service Pack 3 with VS 2017 requires explicit use of the v141_xp Platform Toolset because it requires a Windows 7.1A SDK--the last SDK to support targeting Windows XP. See this blog post for various implications of using this.
The include file explains it:
1. Including SDKDDKVer.h defines the highest available Windows platform.
2. If you wish to build your application for a previous Windows platform, include WinSDKVer.h and set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
So you need to target the minimal Windows version you wish to support and it will then support any version above (and including) it. That has nothing to do with the Windows 10 SDK which supports all previous Windows versions.
Related
I have a C++ project written using Visual Studio 2017. In the project 'Properties' , Under General section i have Target Platform and Windows SDK Version.
When i change the 'Windows SDK version' to 8.1, then i observe that the Target Platform stays set to 'Windows 10' and i have no option of editing that as well. I was thinking that Windows 8.1 SDK can only be used to develop applications for Windows 8. Isn't that right?
Hence shouldn't the Target Platform property be automatically changed to 'Windows 8' when i changed 'Windows SDK version' to 8.1? I can't even edit the Target Platform property which stays greyed out to Windows 10.
Is it possible that i can use Windows SDK 8.1 and still develop programs for Windows 10?
I am developing a Windows Kernel-Mode driver.
I have installed WDK10, Windows SDK linked along with it, and Windows 7 SDK.
I'd like to target windows 7, so I need specific includes, etc., but Visual Studio only allows me to Retarget solution to Win10 or Win8.1, but I need Win7 SDK, for example, if I want to use ZwQuerySystemInformation.
I tried reinstalling everything, but nothing helped.
I'm on Windows 10, so I can't install WDK 7.
Windows 10 WDK allows you to develop drivers for down-level up to Windows 7. I don't think you need WDK 7. To build a driver targeting windows 7 using windows 10 WDK, create a driver project and then in the project properties->Driver->General, set the TargetVersion to Win7
I developed a Win32 program using VC++ 2012 (Express 2012 for Windows Desktop). I chose "Win32" / "Win32 Console Application" while setting up my project. I can run it at Win-7, but failed at POSReady 2009, which is close to WinXP. While I ran it under POSReady 2009, it shows as title.
Is there any way to configure project property on VC++2012 or any other ways to conquer it? Thanks.
You need to install VS 2012 Update 1 or later or VS 2013 Express, and set your Platform Toolset to "v110_xp" or "v120_xp" to make an application that is compatible with Windows XP Service Pack 3 / Windows Server 2003 Service Pack 2).
The key difference between the "v110"/"v120" and "v110_xp"/"v120_xp" Platform Toolset is the Windows SDK. "v110"/"v120" builds with the Windows 8.x SDK which supports targeting Windows Vista or later. It is not possible to build a Windows XP compatible application using the Windows 8.x SDK. Therefore, to target Windows XP / Windows Server 2003 you have to use the alternative Platform Toolset which uses the Windows SDK 7.1A which is included with Express for Windows Desktop.
With either Windows SDK, be sure to set _WIN32_WINNT appropriately for the OSes you are targeting. See Using the Windows Headers. For Windows XP / Windows Server 2003 set it to _WIN32_WINNT=0x0501
Note that for DirectX development, this has some important impacts because the Windows 7.1 SDK was before the DirectX SDK integration that was done for the Windows 8.x SDK. See this blog post for more details.
I've installed Windows Phone SDK 8.0 and there are no project types for desktop windows RT applications.
How can I develop this type of applications?
Windows RT is not associated with the Phone SDK - it comes from the main desktop development environment.
Microsoft does not allow desktop apps to be built for Windows RT. The RT desktop is limited to make the office applications work, but does not include the full windows functionality.
To develop windows 8 desktop apps, you use Visual Studio as you would have in the past for desktop apps.
To build a windows store app you would go under c# and select Windows Store. Tutorials located at Microsoft. There you will get a selection of templates you can build from to make your app. I expect these templates will also build apps that can run on a Windows RT device. (I haven't tested that though)
Creating desktop applications for Windows RT?
Technically, you cannot develop Desktop Applications for Windows RT. Its not officially supported by Microsoft. You can develop Store Applications for it, though. Store Apps used to be called Metro Apps, but Microsoft was exposed to legal risk with the name (see Microsoft to drop 'Metro' name for Windows 8).
For hacking around the restriction, see Can ARM desktop programs be built using visual studio 2012. However, your app will likely be rejected from Microsoft's Windows Store if you submit it.
...are no project types for desktop windows RT applications.
Windows RT is there - you want a Windows Store app:
The Windows Store App project will define WINAPI_FAMILY=WINAPI_FAMILY_APP. It will have three platforms: X86, X64 and ARM. Windows RT Pro is X64. Windows RT is ARM. I'm not sure what X86 is classified as. For developers and engineers, its all just WINAPI_FAMILY=WINAPI_FAMILY_APP with three platforms. There's no difference between Pro and non-Pro under Visual Studio (some hand waiving).
For some good reading on WINAPI_FAMILY and platform detection, see Chuck Walbourn's three part series Dual-use Coding Techniques for Games.
With some hand waiving, the backend difference between Windows Phone and Windows Store is:
Windows RT uses the compiler located at
%VSINSTALLDIR%\VC\bin\x86_ARM\CL.exe
Windows Phone uses the compiler located at
%VSINSTALLDIR%\VC\WPSDK\WP80\bin\x86_arm\link.exe
Obviously, the paths change when platforms change. But the linker (link.exe) and other tools (like lib.exe) are in the same directory as the compiler.
The environment for Windows RT (ARM) is labeled Visual Studio 2012 ARM Cross Tools Command Prompt. You can find it at Start (what's left of it) → Program Files → Visual Studio 2012 → Visual Studio Tools:
The environment for Windows Phone (ARM) is labeled Visual Studio 2012 ARM Phone Tools Command Prompt:
Similarly, the environment for Windows Phone (X86) is labeled Visual Studio 2012 X86 Phone Tools Command Prompt; and Windows RT Pro (X64) is labeled Visual Studio 2012 X64 Cross Tools Command Prompt.
All the command prompts set the environment so INCLUDE, LIBPATH, PATH etc are ready for command line development. To date, that's all I have used because I have been porting libraries. I have not use Visual Studio for a project yet.
You will also want to look over Can ARM desktop programs be built using visual studio 2012 for the _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE=1 define.
Also see Jason Zander’s What you need to know about developing for Windows on ARM (WOA) on MSDN.
Finally, see Desktop apps ported to Windows RT on XDA Developers forum.
You can sort of hack Visual Studio 2012 and later to allow you to reference RT in windows desktop apps.
1.) Unload your project in Visual Studio
2.) Add a TargetPlatformVersion property to the project:
<PropertyGroup>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
</PropertyGroup>
3.) Reload the project.
4.) Go to "Add Reference..."
5.) There should now be an additional Windows option on the left panel that allows you to add the Windows Core reference.
For more information see Using Windows 8* WinRT API from desktop applications
Windows Phone 8 and Windows 8 are two separate products and require 2 separate SDKs to develop for. Windows Phone 8 runs on mobile devices only, while Windows 8 runs on desktops, laptops and tablets.
All you need to do to build Windows 8 apps is a machine with Windows 8 and Visual Studio 2012 installed on it. You can use the 90 day evaluation for Windows 8 Enterprise with the Express (free) edition of Visual Studio to build such apps. If you are a student you get full version of Visual Studio for free via the Dreamspark program.
To develop Windows Store apps, you need Visual Studio 2012.
The Visual Studio Express that comes with the Windows Phone SDK does not have the templates for developing Windows Store apps.
I get the following message in a VC6 project compile:
OTE: WINVER has been defined as 0x0500 or greater which enables
Windows NT 5.0 and Windows 98 features. When these headers were released,
Windows NT 5.0 beta 1 and Windows 98 beta 2.1 were the current versions.
For this release when WINVER is defined as 0x0500 or greater, you can only
build beta or test applications. To build a retail application,
set WINVER to 0x0400 or visit http://www.microsoft.com/msdn/sdk
to see if retail Windows NT 5.0 or Windows 98 headers are available.
See the SDK release notes for more information.
Any idea what is going on?
It builds and links fine.
I have VC6, VS2005 and 2008 on my XP machine.
Perhaps my Platform SDK is not up to date?
The warning message you're seeing is from the Platform SDK that was supplied with the Visual C++ 6.0 installation, which it seems dates from when Windows 2000 was in beta.
If your application requires WINVER to be 0x0500, and you still need to use Visual C++ 6.0, I would recommend that you install a more recent Platform SDK. According to this blog post, the most recent Platform SDK that is compatible with Visual C++ 6.0 is the February 2003 edition. (There's another post here that may be useful.)
A word of caution, though - I don't know whether the February 2003 Platform SDK will coexist with your Visual Studio 2005 and 2008 installations.
Or VC6's include path doesn't include your SDK and it's only using the ones that came with VC6.
Did you installed the latest VC6 Service pack?