执行Google OR-Tools的make all时出现LNK1112错误求助
Troubleshooting Google OR-Tools "make all" Error in VS2017 x64 Native Tools Command Prompt
Hey there, let's work through this build error you're facing with Google OR-Tools. I've debugged similar issues with MSVC toolchains before, so here are targeted fixes to try:
Verify your command prompt and VS installation
- Double-check you're using the x64 Native Tools Command Prompt for VS 2017 (not x86 or regular cmd). Run
echo %PLATFORM%to confirm it outputsx64. - Open the VS 2017 Installer and ensure the Desktop development with C++ workload is fully installed, including the MSVC v141 toolset and a compatible Windows 10 SDK (10.0.17763.0 or newer is recommended).
- Double-check you're using the x64 Native Tools Command Prompt for VS 2017 (not x86 or regular cmd). Run
Check OR-Tools version and path
- Make sure your OR-Tools version supports VS2017: newer releases (v9.1+) dropped support for VS2017, so stick to v9.0 or older if you're stuck on VS2017.
- Extract OR-Tools to a path with no spaces or Chinese characters (e.g.,
C:\ortoolsinstead ofC:\Program Files\OR Tools). Special characters often break path resolution during compilation.
Tweak build parameters
- Before running
make all, set the MSVC toolset version explicitly:set MSVC_VERSION=14.1 - If the error is link-related (your truncated log hints at this), confirm all required OR-Tools libraries exist in the
libdirectory (likeortools.lib).
- Before running
Clean and rebuild
- First run
make cleanto wipe any corrupted temporary build files, then executemake allagain. Stale objects can cause weird, hard-to-track errors.
- First run
Share the full error log
- The error message you provided is cut off. If the above steps don't fix it, post the complete output—including the exact error code, missing files, or syntax issues. That will let us pinpoint the root cause faster!
内容的提问来源于stack exchange,提问作者Fugui
相关产品推荐
相关产品推荐

