From e3d5cb382f929fb8fb2f3a7a9f9b50ea4c80f41b Mon Sep 17 00:00:00 2001 From: Colin Robertson Date: Thu, 1 Apr 2021 16:01:34 -0700 Subject: [PATCH 1/3] Add C1090 documentation --- ...ompiler-fatal-errors-c999-through-c1999.md | 4 +-- .../compiler-errors-1/fatal-error-c1090.md | 28 +++++++++++++++++++ docs/error-messages/toc.yml | 2 ++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 docs/error-messages/compiler-errors-1/fatal-error-c1090.md diff --git a/docs/error-messages/compiler-errors-1/compiler-fatal-errors-c999-through-c1999.md b/docs/error-messages/compiler-errors-1/compiler-fatal-errors-c999-through-c1999.md index e8ce6ad35bf..f24db7c8a5a 100644 --- a/docs/error-messages/compiler-errors-1/compiler-fatal-errors-c999-through-c1999.md +++ b/docs/error-messages/compiler-errors-1/compiler-fatal-errors-c999-through-c1999.md @@ -82,7 +82,7 @@ The articles in this section of the documentation explain a subset of the error |[Fatal error C1087](fatal-error-c1087.md)|cannot tell *type* file: '*file*': *message*| |[Fatal error C1088](fatal-error-c1088.md)|cannot flush *type* file: '*file*': *message*| |[Fatal error C1089](fatal-error-c1089.md)|cannot truncate *type* file: '*file*': *message*| -|Fatal error C1090|PDB API call failed, error code '*code*': '*message*'| +|[Fatal error C1090](fatal-error-c1090.md)|PDB API call failed, error code '*code*': '*message*'| |[Fatal error C1091](fatal-error-c1091.md)|compiler limit: string exceeds *number* bytes in length| |[Fatal error C1092](../../error-messages/compiler-errors-1/fatal-error-c1092.md)|Edit and Continue does not support changes to data types; build required| |[Fatal error C1093](../../error-messages/compiler-errors-1/fatal-error-c1093.md)|API call '*function*' failed '*HRESULT*' : '*description*'| @@ -100,7 +100,7 @@ The articles in this section of the documentation explain a subset of the error |[Fatal error C1109](fatal-error-c1109.md)|unable to find '*symbol*' in DLL '*file*'| |Fatal error C1110|too many nested template/generic definitions| |Fatal error C1111|too many template/generic parameters| -|Fatal error C1112|compiler limit: `'number`' too many macro arguments, only *number* allowed| +|Fatal error C1112|compiler limit: '*number*' too many macro arguments, only *number* allowed| |[Fatal error C1113](../../error-messages/compiler-errors-1/fatal-error-c1113.md)|#using failed on '*file*'| |Fatal error C1114|'*file*': WinRT does not support #using of a managed assembly| |[Fatal error C1120](../../error-messages/compiler-errors-1/fatal-error-c1120.md)|call to GetProcAddress failed for '*function*'| diff --git a/docs/error-messages/compiler-errors-1/fatal-error-c1090.md b/docs/error-messages/compiler-errors-1/fatal-error-c1090.md new file mode 100644 index 00000000000..faebeb7015a --- /dev/null +++ b/docs/error-messages/compiler-errors-1/fatal-error-c1090.md @@ -0,0 +1,28 @@ +--- +description: "Learn more about: Fatal Error C1090 PDB API call failed" +title: "Fatal Error C1090" +ms.date: 04/01/2021 +f1_keywords: ["C1090"] +helpviewer_keywords: ["C1090"] +--- +# Fatal Error C1090 + +> PDB API call failed, error code '*error-number*': *message* + +An error occurred in processing a PDB file. + +Error C1090 is a catch-all for uncommon compiler PDB file errors that aren't reported separately. We only have generic advice for resolving this issue: + +- Do a clean operation in your build directories, and then do a full build of your solution. + +- Reboot your computer, or check for stray or unresponsive mspdbsrv.exe processes and kill them in TaskManager. + +- Turn off antivirus checks in your project directories. + +- Use the [`/Zf`](../../build/reference/zf.md) compiler option if using [`/MP`](../../build/reference/mp-build-with-multiple-processes.md) with MSBuild or another parallel build process. + +- Try building by using the 64-bit hosted toolset. + +For more troubleshooting or workaround information, search for this error on [Developer Community](https://aka.ms/vsfeedback/browsecpp) or [Stack Overflow](https://stackoverflow.com/questions/tagged/visual-c++). + +You can also report the issue on Developer Community. For more information, see [How to report a problem with the Microsoft C++ toolset](overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md). diff --git a/docs/error-messages/toc.yml b/docs/error-messages/toc.yml index 835da3833c2..ca8632d8f73 100644 --- a/docs/error-messages/toc.yml +++ b/docs/error-messages/toc.yml @@ -203,6 +203,8 @@ href: compiler-errors-1/fatal-error-c1088.md - name: fatal error C1089 href: compiler-errors-1/fatal-error-c1089.md + - name: fatal error C1090 + href: compiler-errors-1/fatal-error-c1090.md - name: fatal error C1091 href: compiler-errors-1/fatal-error-c1091.md - name: fatal error C1092 From b4167eed6194cab2a682df13e58f68fcc277b159 Mon Sep 17 00:00:00 2001 From: Colin Robertson Date: Thu, 1 Apr 2021 16:42:37 -0700 Subject: [PATCH 2/3] Fix link --- docs/error-messages/compiler-errors-1/fatal-error-c1090.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/error-messages/compiler-errors-1/fatal-error-c1090.md b/docs/error-messages/compiler-errors-1/fatal-error-c1090.md index faebeb7015a..3764f4cd32c 100644 --- a/docs/error-messages/compiler-errors-1/fatal-error-c1090.md +++ b/docs/error-messages/compiler-errors-1/fatal-error-c1090.md @@ -23,6 +23,6 @@ Error C1090 is a catch-all for uncommon compiler PDB file errors that aren't rep - Try building by using the 64-bit hosted toolset. -For more troubleshooting or workaround information, search for this error on [Developer Community](https://aka.ms/vsfeedback/browsecpp) or [Stack Overflow](https://stackoverflow.com/questions/tagged/visual-c++). +For more troubleshooting or workaround information, search for this error on [Developer Community](https://aka.ms/vsfeedback/browsecpp) or [Stack Overflow](https://stackoverflow.com/search?q=C1090). -You can also report the issue on Developer Community. For more information, see [How to report a problem with the Microsoft C++ toolset](overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md). +You can also report the issue on Developer Community. For more information, see [How to report a problem with the Microsoft C++ toolset](../../overview/how-to-report-a-problem-with-the-visual-cpp-toolset.md). From ac566933c15e95a3ea0dc1fa9b7476b2ee13d4f6 Mon Sep 17 00:00:00 2001 From: Colin Robertson Date: Thu, 1 Apr 2021 17:43:02 -0700 Subject: [PATCH 3/3] Add /openmp:llvm compiler switch docs --- .../openmp-enable-openmp-2-0-support.md | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/docs/build/reference/openmp-enable-openmp-2-0-support.md b/docs/build/reference/openmp-enable-openmp-2-0-support.md index 5d15ab4105f..59255ae196e 100644 --- a/docs/build/reference/openmp-enable-openmp-2-0-support.md +++ b/docs/build/reference/openmp-enable-openmp-2-0-support.md @@ -1,12 +1,11 @@ --- description: "Learn more about: /openmp (Enable OpenMP Support)" title: "/openmp (Enable OpenMP Support)" -ms.date: "04/15/2019" -f1_keywords: ["/openmp", "VC.Project.VCCLCompilerTool.OpenMP"] -helpviewer_keywords: ["/openmp compiler option [C++]", "-openmp compiler option [C++]"] -ms.assetid: 9082b175-18d3-4378-86a7-c0eb95664e13 +ms.date: 04/01/2021 +f1_keywords: ["/openmp", "/openmp:experimental", "/openmp:llvm", "VC.Project.VCCLCompilerTool.OpenMP"] +helpviewer_keywords: ["/openmp compiler option [C++]", "/openmp:experimental compiler option [C++]", "/openmp:llvm compiler option [C++]", "-openmp compiler option [C++]"] --- -# /openmp (Enable OpenMP Support) +# `/openmp` (Enable OpenMP Support) Causes the compiler to process [`#pragma omp`](../../preprocessor/omp.md) directives in support of OpenMP. @@ -14,39 +13,45 @@ Causes the compiler to process [`#pragma omp`](../../preprocessor/omp.md) direct ::: moniker range=">= msvc-160" -> **/openmp**\[**:**__experimental__] +> **`/openmp`**\ +> **`/openmp:experimental`**\ +> **`/openmp:llvm`** ::: moniker-end ::: moniker range="<= msvc-150" -> **/openmp** +> **`/openmp`** ::: moniker-end ## Remarks -`#pragma omp` is used to specify [Directives](../../parallel/openmp/reference/openmp-directives.md) and [Clauses](../../parallel/openmp/reference/openmp-clauses.md). If **/openmp** isn't specified in a compilation, the compiler ignores OpenMP clauses and directives. [OpenMP Function](../../parallel/openmp/reference/openmp-functions.md) calls are processed by the compiler even if **/openmp** isn't specified. +`#pragma omp` is used to specify [Directives](../../parallel/openmp/reference/openmp-directives.md) and [Clauses](../../parallel/openmp/reference/openmp-clauses.md). If **`/openmp`** isn't specified in a compilation, the compiler ignores OpenMP clauses and directives. [OpenMP Function](../../parallel/openmp/reference/openmp-functions.md) calls are processed by the compiler even if **`/openmp`** isn't specified. ::: moniker range=">= msvc-160" -The C++ compiler currently supports the OpenMP 2.0 standard. However, Visual Studio 2019 also now offers SIMD functionality. To use SIMD, compile by using the **/openmp:experimental** option. This option enables both the usual OpenMP features, and additional OpenMP SIMD features not available when using the **/openmp** switch. +The C++ compiler currently supports the OpenMP 2.0 standard. However, Visual Studio 2019 also now offers SIMD functionality. To use SIMD, compile by using the **`/openmp:experimental`** option. This option enables both the usual OpenMP features, and OpenMP SIMD features not available when using the **`/openmp`** switch. + +Starting in Visual Studio 2019 version 16.9, you can use the experimental **`/openmp:llvm`** option instead of **`/openmp`** to target the LLVM OpenMP runtime. Support currently isn't available for production code, since the required libomp DLLs aren't redistributable. The option supports the same OpenMP 2.0 directives as **`/openmp`**. And, it supports all the SIMD directives supported by the **`/openmp:experimental`** option. It also supports unsigned integer indices in parallel for loops according to the OpenMP 3.0 standard. For more information, see [Improved OpenMP Support for C++ in Visual Studio](https://devblogs.microsoft.com/cppblog/improved-openmp-support-for-cpp-in-visual-studio/). + +Currently, the **`/openmp:llvm`** option only works on the x64 architecture. The option isn't compatible with **`/clr`** or **`/ZW`**. ::: moniker-end -Applications compiled by using both **/openmp** and **/clr** can only be run in a single application domain process. Multiple application domains aren't supported. That is, when the module constructor (`.cctor`) is run, it detects if the process is compiled using **/openmp**, and if the app is loaded into a non-default runtime. For more information, see [appdomain](../../cpp/appdomain.md), [/clr (Common Language Runtime Compilation)](clr-common-language-runtime-compilation.md), and [Initialization of Mixed Assemblies](../../dotnet/initialization-of-mixed-assemblies.md). +Applications compiled by using both **`/openmp`** and **`/clr`** can only be run in a single application domain process. Multiple application domains aren't supported. That is, when the module constructor (`.cctor`) is run, it detects if the process is compiled using **`/openmp`**, and if the app is loaded into a non-default runtime. For more information, see [`appdomain`](../../cpp/appdomain.md), [`/clr` (Common Language Runtime Compilation)](clr-common-language-runtime-compilation.md), and [Initialization of Mixed Assemblies](../../dotnet/initialization-of-mixed-assemblies.md). -If you attempt to load an app compiled using both **/openmp** and **/clr** into a non-default application domain, a exception is thrown outside the debugger, and a `OpenMPWithMultipleAppdomainsException` exception is thrown in the debugger. +If you attempt to load an app compiled using both **`/openmp`** and **`/clr*`* into a non-default application domain, a exception is thrown outside the debugger, and a `OpenMPWithMultipleAppdomainsException` exception is thrown in the debugger. These exceptions can also be raised in the following situations: -- If your application is compiled using **/clr** but not **/openmp**, and is loaded into a non-default application domain, where the process includes an app compiled using **/openmp**. +- If your application is compiled using **`/clr`** but not **`/openmp`**, and is loaded into a non-default application domain, where the process includes an app compiled using **`/openmp`**. -- If you pass your **/clr** app to a utility, such as [regasm.exe](/dotnet/framework/tools/regasm-exe-assembly-registration-tool), which loads its target assemblies into a non-default application domain. +- If you pass your **`/clr`** app to a utility, such as [regasm.exe](/dotnet/framework/tools/regasm-exe-assembly-registration-tool), which loads its target assemblies into a non-default application domain. The common language runtime's code access security doesn't work in OpenMP regions. If you apply a CLR code access security attribute outside a parallel region, it won't be in effect in the parallel region. -Microsoft doesn't recommend that you write **/openmp** apps that allow partially trusted callers. Don't use , or any CLR code access security attributes. +Microsoft doesn't recommend that you write **`/openmp`** apps that allow partially trusted callers. Don't use , or any CLR code access security attributes. ### To set this compiler option in the Visual Studio development environment @@ -64,9 +69,9 @@ Microsoft doesn't recommend that you write **/openmp** apps that allow partially The following sample shows some of the effects of thread pool startup versus using the thread pool after it has started. Assuming an x64, single core, dual processor, the thread pool takes about 16 ms to start up. After that, there's little extra cost for the thread pool. -When you compile using **/openmp**, the second call to test2 never runs any longer than if you compile using **/openmp-**, as there's no thread pool startup. At a million iterations, the **/openmp** version is faster than the **/openmp-** version for the second call to test2. At 25 iterations, both **/openmp-** and **/openmp** versions register less than the clock granularity. +When you compile using **`/openmp`**, the second call to test2 never runs any longer than if you compile using **`/openmp-`**, as there's no thread pool startup. At a million iterations, the **`/openmp`** version is faster than the **`/openmp-`** version for the second call to test2. At 25 iterations, both **`/openmp-`** and **`/openmp`** versions register less than the clock granularity. -If you have only one loop in your application and it runs in less than 15 ms (adjusted for the approximate overhead on your machine), **/openmp** may not be appropriate. If it's higher, you may want to consider using **/openmp**. +If you have only one loop in your application and it runs in less than 15 ms (adjusted for the approximate overhead on your machine), **`/openmp`** may not be appropriate. If it's higher, you may want to consider using **`/openmp`**. ```cpp // cpp_compiler_options_openmp.cpp @@ -114,6 +119,6 @@ int main(int argc, char* argv[]) { ## See also -[MSVC Compiler Options](compiler-options.md) \ -[MSVC Compiler Command-Line Syntax](compiler-command-line-syntax.md) \ +[MSVC compiler options](compiler-options.md) \ +[MSVC compiler command-line syntax](compiler-command-line-syntax.md) \ [OpenMP in MSVC](../../parallel/openmp/openmp-in-visual-cpp.md)