cjlin1/liblinear

fatal error C1083: “math.h”: No such file or directory

Opened this issue · 5 comments

When I compile liblinear in Windows 10 with VS2019, I get the following error:

D:\liblinear-2.30>nmake -f Makefile.win lib

Microsoft (R) 程序维护实用工具 14.26.28805.0 版
版权所有 (C) Microsoft Corporation。 保留所有权利。

    cl.exe /nologo /O2 /EHsc /I. /D _WIN64 /D _CRT_SECURE_NO_DEPRECATE -c tron.cpp

tron.cpp
tron.cpp(1): fatal error C1083: 无法打开包括文件: “math.h”: No such file or directory
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe"”: 返回代码“0x2”
Stop.

How to fix it?

Yes, I have done the first step:

D:\liblinear-2.30>"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"


** Visual Studio 2019 Developer Command Prompt v16.6.0
** Copyright (c) 2020 Microsoft Corporation


[vcvarsall.bat] Environment initialized for: 'x64'

D:\liblinear-2.30>nmake -f Makefile.win lib

Microsoft (R) 程序维护实用工具 14.26.28805.0 版
版权所有 (C) Microsoft Corporation。 保留所有权利。

    cl.exe /nologo /O2 /EHsc /I. /D _WIN64 /D _CRT_SECURE_NO_DEPRECATE -c tron.cpp

tron.cpp
tron.cpp(1): fatal error C1083: 无法打开包括文件: “math.h”: No such file or directory
NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX64\x64\cl.exe"”: 返回代码“0x2”
Stop.

I encountered the same question with Visual Studio 2017 as murongxixi, and I have done the first step. @cjlin1

DId you do the first step indicated in README like: 1. Open a dos command box and change to liblinear directory. If environment variables of VC++ have not been set, type "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"

On 2020-05-22 13:01, murongxixi wrote: When I compile liblinear in Windows 10 with VS2019, I get the following error: D:\liblinear-2.30>nmake -f Makefile.win lib Microsoft (R) 程序维护实用工具 14.26.28805.0 版 版权所有 (C) Microsoft Corporation。 保留所有权利。 cl.exe /nologo /O2 /EHsc /I. /D _WIN64 /D _CRT_SECURE_NO_DEPRECATE -c tron.cpp -lm cl: 命令行 warning D9002 :忽略未知选项“-lm” tron.cpp tron.cpp(1): fatal error C1083: 无法打开包括文件: “math.h”: No such file or directory NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x86\cl.exe"”: 返回代码“0x2” Stop. How to fix it? -- You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. [ { @.": "http://schema.org", @.": "EmailMessage", "potentialAction": { @.": "ViewAction", "target": "#62", "url": "#62", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { @.": "Organization", "name": "GitHub", "url": "https://github.com" } } ] Links: ------ [1] #62 [2] https://github.com/notifications/unsubscribe-auth/ABI3BHT74J66ZOBMKXP3UYTRSYBJHANCNFSM4NHPIOOQ

This problem has been solved by my colleague's suggestion;
Visual Studio Installer > Game Development with C++ > Optional ; Install different "Window 10 SDK(10.0.22000.0) and so on
after that simple test the 'hello world' program.
Good luck indeed for all this queries finder.