[Windows] MSVC Compilation Error: C2001 and C2143 in multiple source files (e.g., routing_lp_scheduling.cc)
- 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)**
CMake v4.1.1
Git v2.51.0.windows.1
Visual Studio Community 2022 v17.14.13
x64 Native Tools Command Prompt for VS 2022
**What operating system (Linux, Windows, ...) and version?**
OS: Windows11 Family Chinese
**What did you do?**
Steps to reproduce the behavior:
1. I follow the instruction in https://developers.google.com/optimization/install/cpp/source_windows?hl=zh-cn
2. After get the code from Git and build CMake, I use command (as same as in the website)
cmake --build build --config Release --target ALL_BUILD -j -v
to compile the program
4. After finishing compile, I scroll down to the bottom of x64 Native Tools Command Prompt for VS 2022
5. So that I see 17 warnings and 10 errors, in the following files(line numbers might vary slightly)
[info_of_errors.txt](https://github.com/user-attachments/files/22143405/info_of_errors.txt)
The following 2 parts is concluded by Deepseek. I talk to him about the problems I met. He help me to generate these parts when I told him that I want to create a issue.
## Steps to Reproduce
1. git clone -b stable https://github.com/google/or-tools.git
2. cd or-tools
3. cmake -S . -B build -DBUILD_DEPS=ON
4. cmake --build build --config Release --target ALL_BUILD -j -v
## What I've Tried
* Ensured `core.autocrlf` is set to `false` and performed multiple clean clones.
* Verified that the line endings (LF) and file encoding (UTF-8 without BOM) of the problematic files are correct using VS Code.
* Manually re-typing the offending string literals and saving the files.
* The fact that the error persists in a clean environment suggests it might be an issue with the source code in the repository itself, not a local configuration.
Contributor guide
Assessment
This issue has not been assessed yet.