MSVC Solution and C1011 Error

MSVS Community Edition, v17.12.5 (latest), Win10 (latest), 64-bit

I've raised an issue with MS, but after their acknowledging that they've replicated the problem (with a copy of my entire solution), they've ghosted me, saying that they'll focus on problems affecting the wider community. They've not responded to further inquiries and the issue's status is now "Under Consideration". Meanwhile, I'm stuck with a solution that won't build.

Links to the relevant webpages at the bottom.

Short version:
I’m getting a C1011 error in a C++ console project that imports the STL (import std;). I followed the MS C1011 help page but the error persists. I don’t know how MSVS wants me to locate the STL module interface.

Long version:
In fact, I have two different C++ solutions, each for console and containing a single project accessing the SLT using import std;. In the first I’m using a mixture of #include <xxx.hpp> and import xxx; across 9 of my own .cpp files (i.e. 6 have .hpp; 3 have .ixx interfaces). The second solution is self-contained – there are no #includes only import std;.

I was successfully building both with /experimental:module and /std:c++latest[/quote] iaw the guidance offered in the MS article "Overview of modules in C++". I have Configuration Properties > C/C++ > Language Build ISO C++23 Standard Library Modules enabled (so I shouldn’t have to build the STL module myself, iaw Tutorial: Import C++ STL Using Modules, right?).

Having not touched either solution in over a month, I rebuilt them after the latest MSVS updates (17.12.4 and 17.12.5) which promptly generated LNK1318 errors. Removing the /experimental:module flag (iaw MS problem report "fatal error LNK1319") resolved the problem on the second solution.

Implementing that fix on the first solution instead generates a fatal C1011 error. I confirmed the Build ISO C++23 STL Module and /stdc++latest flags are enabled and ensured that I have installed the Modules for v143 build tools component via the VS Installer (from the C1011 help page). That matches the solution's Configuration Properties > General > Platform Toolset (v143).

Paradoxically, the Build output shows:
Target ComputeStdModulesCompileInputs:
1> Reading library manifest file ‘D:\Programs\Visual Studio 2022\VC\Tools\MSVC\14.42.34433\modules\modules.json’ which provides data for library ‘microsoft/STL’.
1> Adding module source ‘D:\Programs\Visual Studio 2022\VC\Tools\MSVC\14.42.34433\modules\std.ixx’ from library ‘microsoft/STL’ to be built with this project.
1> Adding module source ‘D:\Programs\Visual Studio 2022\VC\Tools\MSVC\14.42.34433\modules\std.compat.ixx’ from library ‘microsoft/STL’ to be built with this project.

and the files (built 19 Jan 2025) exist on that path.

The error location suggests that this has something to do with my use of import std.filesystem; immediately after an import std; but if I remove the former I resolve the first error and then get 5 more C1011 errors in two .hpp files all on import std.filesystem; Has std.filesystem been incorporated into std?

What am I missing? Can anyone help?

https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/fatal-error-c1011?view=msvc-170&f1url=%3FappId%3DDev17IDEF1%26l%3DEN-US%26k%3Dk(C1011)%26rd%3Dtrue
https://learn.microsoft.com/en-us/cpp/cpp/modules-cpp?view=msvc-170
https://learn.microsoft.com/en-us/cpp/cpp/tutorial-import-stl-named-module?view=msvc-170&source=docs
https://developercommunity.visualstudio.com/t/fatal-error-LNK1318:-Unexpected-PDB-erro/10791875
Last edited on
They've not responded to further inquiries and the issue's status is now "Under Consideration".


I sympathize. In the past I've had several accepted issues 'Under consideration', 'In progress' etc for months - sometimes for over a year - until MS got round to fixing it. The only real way to put some pressure onto MS is if many others also report the same issue. That will then 'bump it up' the priority ladder. But as they're saying they can't reproduce then I doubt they're put in much effort.

PS. Have you tried the code with godbolt (godbolt.org)? If that fails then you can send MS the appropriate link. If it works then its likely it's something to do with your installation/setup/configuration.
Last edited on
Thanks for the commiserations.

I believe the project to be way too big for Compiler Explorer but I have been considering trying GCC or Clang from the command line. The effort to make it compatible might be more than I want to dedicate.

It's not as if I can start removing parts of the project in a effort to reduce it to the minimum set. There's too much integration. Given that I can compile another, much smaller solution without error suggest it's something in the setup of my bigger one.

I'm at a complete standstill until I can figure out a way forward. In the absence of any suggestions here, my next step is StackOverflow but occasionally the answers there go way over my head.
Registered users can post here. Sign in or register to post.