Skip to content

Repo sync for protected CLA branch #4693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docs/build/reference/link-code-for-kernel-mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
description: "Learn more about: /KERNEL (Create kernel mode binary)."
title: /KERNEL
ms.date: "08/25/2023"
---
# /KERNEL (Create kernel mode binary)

Create a binary that is suitable for running in kernel mode.

## Syntax

> **`/KERNEL`**

## Remarks

Causes the linker to emit a warning if any object file or library linked in the binary wasn't compiled with [/kernel](kernel-create-kernel-mode-binary.md).

Code that can run in kernel mode must be compiled with the **`/kernel`** option. If you link a binary that contains code that wasn't compiled with **`/kernel`**, the binary might not run correctly in kernel mode.

Code for kernel mode is compiled with a simplified set of C++ language features that are specific to code that runs in kernel mode. The compiler produces warnings for C++ language features that are potentially disruptive but can't be disabled. For more information about compiling code in kernel mode, see [/kernel (Create kernel mode binary)](kernel-create-kernel-mode-binary.md).

### To set this linker option in Visual Studio

1. Open the project **Property Pages** dialog box. For more information, see [Set C++ compiler and build properties in Visual Studio](../working-with-project-properties.md).

1. Select the **Configuration Properties** > **Linker** > **Command Line** property page.

1. In **Additional Options**, enter `/KERNELMODE`.

## See also

- [MSVC linker reference](linking.md)
- [MSVC linker options](linker-options.md)
- [Compiler options: /kernel](kernel-create-kernel-mode-binary.md)
9 changes: 3 additions & 6 deletions docs/build/reference/linker-options.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
title: "MSVC Linker options"
description: "A list of the options supported by the Microsoft LINK linker."
ms.date: 09/27/2022
ms.date: 08/25/2023
f1_keywords: ["link"]
helpviewer_keywords: ["linker [C++]", "linker [C++], options listed", "libraries [C++], linking to COFF", "LINK tool [C++], linker options"]
ms.assetid: c1d51b8a-bd23-416d-81e4-900e02b2c129
---
# Linker options

Expand All @@ -13,11 +12,8 @@ LINK.exe links Common Object File Format (COFF) object files and libraries to cr
The following table lists options for LINK.exe. For more information about LINK, see:

- [Compiler-controlled LINK options](compiler-controlled-link-options.md)

- [LINK input files](link-input-files.md)

- [LINK output](link-output.md)

- [Reserved words](reserved-words.md)

On the command line, linker options aren't case-sensitive; for example, `/base` and `/BASE` mean the same thing. For details on how to specify each option on the command line or in Visual Studio, see the documentation for that option.
Expand All @@ -43,7 +39,7 @@ You can use the [`comment`](../../preprocessor/comment-c-cpp.md) pragma to speci
| [`/CLRIMAGETYPE`](clrimagetype-specify-type-of-clr-image.md) | Sets the type (IJW, pure, or safe) of a CLR image. |
| [`/CLRSUPPORTLASTERROR`](clrsupportlasterror-preserve-last-error-code-for-pinvoke-calls.md) | Preserves the last error code of functions that are called through the P/Invoke mechanism. |
| [`/CLRTHREADATTRIBUTE`](clrthreadattribute-set-clr-thread-attribute.md) | Specifies the threading attribute to apply to the entry point of your CLR program. |
| [`/CLRUNMANAGEDCODECHECK`](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md) | Specifies whether the linker will apply the `SuppressUnmanagedCodeSecurity` attribute to linker-generated P/Invoke stubs that call from managed code into native DLLs. |
| [`/CLRUNMANAGEDCODECHECK`](clrunmanagedcodecheck-add-suppressunmanagedcodesecurityattribute.md) | Specifies whether the linker applies the `SuppressUnmanagedCodeSecurity` attribute to linker-generated P/Invoke stubs that call from managed code into native DLLs. |
| [`/DEBUG`](debug-generate-debug-info.md) | Creates debugging information. |
| [`/DEBUGTYPE`](debugtype-debug-info-options.md) | Specifies which data to include in debugging information. |
| [`/DEF`](def-specify-module-definition-file.md) | Passes a module-definition (.def) file to the linker. |
Expand Down Expand Up @@ -75,6 +71,7 @@ You can use the [`comment`](../../preprocessor/comment-c-cpp.md) pragma to speci
| [`/INCREMENTAL`](incremental-link-incrementally.md) | Controls incremental linking. |
| [`/INFERASANLIBS`](inferasanlibs.md) | Uses inferred sanitizer libraries. |
| [`/INTEGRITYCHECK`](integritycheck-require-signature-check.md) | Specifies that the module requires a signature check at load time. |
| [`/KERNEL`](link-code-for-kernel-mode.md) | Create a kernel mode binary. |
| [`/KEYCONTAINER`](keycontainer-specify-a-key-container-to-sign-an-assembly.md) | Specifies a key container to sign an assembly. |
| [`/KEYFILE`](keyfile-specify-key-or-key-pair-to-sign-an-assembly.md) | Specifies a key or key pair to sign an assembly. |
| [`/LARGEADDRESSAWARE`](largeaddressaware-handle-large-addresses.md) | Tells the compiler that the application supports addresses larger than 2 gigabytes |
Expand Down
2 changes: 2 additions & 0 deletions docs/build/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,8 @@ items:
href: ../build/reference/inferasanlibs.md
- name: /INTEGRITYCHECK (Require signature check)
href: ../build/reference/integritycheck-require-signature-check.md
- name: /KERNEL (Create a kernel mode binary)
href: ../build/reference/link-code-for-kernel-mode.md
- name: /KEYCONTAINER (Specify a key container to sign an assembly)
href: ../build/reference/keycontainer-specify-a-key-container-to-sign-an-assembly.md
- name: /KEYFILE (Specify key or key pair to sign an assembly)
Expand Down
10 changes: 8 additions & 2 deletions docs/overview/what-s-new-for-visual-cpp-in-visual-studio.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ For more information on what's new in all of Visual Studio, see [What's new in V

For a summary of new C++ features in Visual Studio 17.7, see [What’s New for C++ Developers in Visual Studio 2022 17.7](https://devblogs.microsoft.com/cppblog/whats-new-for-c-developers-in-visual-studio-2022-17-7/).

Briefly, some of the new features are: faster debugging sessions and faster project load times, step-by-step visualization of macro expansion, one-click download for Windows Subsystem for Linux (WSL), improved support for Doxygen comments, C++ Build Insights for game development, and Unreal Engine project improvements such as faster IntelliSense and syntax colorization, the ability to find all Unreal Engine Blueprint references, and more.
Briefly, some of the new features are:
* Faster debugging sessions and faster project load times
* Step-by-step visualization of macro expansion
* One-click download for Windows Subsystem for Linux (WSL)
* Improved support for Doxygen comments
* C++ Build Insights for game development
* Unreal Engine project improvements such as faster IntelliSense and syntax colorization, the ability to find all Unreal Engine Blueprint references, and more.

For a summary of new C++ features that are specific to game development, see [Unleashing the Power of Visual Studio 2022 for C++ Game Development](https://devblogs.microsoft.com/visualstudio/unleashing-the-power-of-visual-studio-2022-for-c-game-development/#:~:text=Unleashing%20the%20Power%20of%20Visual%20Studio%202022%20for,6%20Optimizing%20Build%20Times%20in%20Visual%20Studio%20)

For a summary of new features in the Visual Studio 17.7 IDE, see[Visual Studio 2022 version 17.7 Release Notes](/visualstudio/releases/2022/release-notes).
For a summary of new features in the Visual Studio 17.7 IDE, see [Visual Studio 2022 version 17.7 Release Notes](/visualstudio/releases/2022/release-notes).

## What's new for C++ in Visual Studio version 17.6

Expand Down