Build failed in Japanese version of Windows 11
- Dominant language
- C++
- Stars
- 14.1k
- Forks
- 2.5k
- Avg merge
- 8h 39m
- Merged PRs (30d)
- 72
Description
**What version of OR-Tools and what language are you using?**
Version: v9.14
Language: C#
**Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)**
**What operating system (Linux, Windows, ...) and version?**
Windows 11 24H2 (Japanese)
**What did you do?**
Steps to reproduce the behavior:
1. `git clone https://github.com/google/or-tools.git`
2. `cd or-tools`
3. `cmake -S . -Bbuild -DBUILD_DEPS=ON -DBUILD_DOTNET=ON`
4. `cmake --build build --target dotnet_package -v`
5. See error
The error occurs even in step3 on the Japanese version of Windows 11.
To work around this, the patch https://github.com/google/or-tools/discussions/4725#discussioncomment-13749433 is applied.
**What did you expect to see**
Build succeeds.
**What did you see instead?**
Errors [C2001](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2001) and [C2143](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2143) and warning [C4819](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4819) occur.
The entire build log is attached below (in Japanese).
[build.log](https://github.com/user-attachments/files/21239744/build.log)
**Anything else we should know about your project / environment**
Visual Studio 2022 v17.14.9
**Workaround**
```diff
list(APPEND OR_TOOLS_COMPILE_OPTIONS
"/bigobj" # Allow big object
"/DNOMINMAX"
"/DWIN32_LEAN_AND_MEAN=1"
"/D_CRT_SECURE_NO_WARNINGS"
"/D_CRT_SECURE_NO_DEPRECATE"
"/MP" # Build with multiple processes
"/Zc:preprocessor" # Enable preprocessor conformance mode
"/fp:precise"
+ "/source-charset:utf-8"
)
```
https://github.com/google/or-tools/blob/v9.14/cmake/cpp.cmake#L101-L110
Contributor guide
Assessment
This issue has not been assessed yet.