Skip to content

/Zc:preprocessor breaks compilation on Windows #4748

@Please-just-dont

Description

@Please-just-dont

Describe the bug
Using flag /Zc:preprocessor OR /Zc:__cplusplus prevents project from compiling.

Version
Latest release source obtained from the Releases.

To Reproduce
Link to repo. Build with CMake. Notice that the /Zc:preprocessor flag prevents it from compiling.

Expected behavior
Expected to compile

Actual Result
Doesn't compile. Gives linker error:

# LNK1181 cannot open input file 'CMakeFiles\wamr_lib.dir\wasm-micro-runtime\core\iwasm\common\arch\invokeNative_em64.asm.obj'

Link to explanation about Zc:preprocessor:

This option enables a token-based preprocessor that conforms to C99 and C++11 and later standards....
We're updating the Microsoft C++ preprocessor to improve standards conformance, fix longstanding bugs, and change some behaviors that are officially undefined. We've also added new diagnostics to warn on errors in macro definitions.

Also happens with /Zc:__cplusplus, it seems the /Zc flags are causing it.

Desktop (please complete the following information):

  • Arch [x86_64]
  • Windows 11
  • MSVC 2026 - Version: 18.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions