Build issues

263 views
Skip to first unread message

iijj22gg

unread,
May 11, 2021, 12:24:26 PM5/11/21
to ninja-build
Hello

I've been needing to use ninja for quite some time, but I'm having problems building it.

CMake won't build it because "No CMAKE_CXX_COMPILER could be found."
The Python file fails because it can't find the files it needs in the VSC folder.

I've tried reinstalling VSC and CMake, which have never given me trouble until today. I think I should note that I'm using VSC 2019 instead of 2015, but I doubt that's the problem.

jha...@gmail.com

unread,
May 11, 2021, 12:25:48 PM5/11/21
to ninja-build
Hi,

VSC == Visual Studio Community?

Can you post the full output of the CMake command?

iijj22gg

unread,
May 12, 2021, 11:11:47 AM5/12/21
to ninja-build
No, by VSC I mean Visual Studio Code. I use "Visual Studio 2019 Developer Command Prompt v16.4.3" as it appears to be titled. It has been working for me.

Okay, here is the output:

.\ninja> cmake -Bbuild-cmake -H.
-- Selecting Windows SDK version  to target Windows 10.0.19042.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
  No CMAKE_C_COMPILER could be found.



CMake Error at CMakeLists.txt:6 (project):
  No CMAKE_CXX_COMPILER could be found.



-- Configuring incomplete, errors occurred!
See also ...

jha...@gmail.com

unread,
May 12, 2021, 11:13:47 AM5/12/21
to ninja-build
You'll need to install Visual Studio with C++ support. From the Microsoft documentation:

If you have a recent version of Visual Studio, open the Visual Studio Installer from the Windows Start menu and verify that the C++ workload is checked. If it's not installed, then check the box and click the Modify button in the installer.

After installing it, try again.

iijj22gg

unread,
May 14, 2021, 11:47:17 AM5/14/21
to ninja-build

Okay, so I tried that, but the C++ package was already existent. I did update Visual Studio Community, but it gives me the same error.
Also, the update added vcvarsall.bat, which was previously not in my installation, so I tried that with the Python build option, which gave me the same error as previously:

./ninja>python configure.py --bootstrap
bootstrapping ninja...
warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build.
build.cc
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\cstdio(12): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory

iijj22gg

unread,
May 29, 2021, 3:24:17 PM5/29/21
to ninja-build
Any suggestions? I'm still stuck here...

Ben Boeckel

unread,
May 29, 2021, 8:59:40 PM5/29/21
to iijj22gg, ninja-build
On Thu, May 13, 2021 at 08:24:20 -0700, iijj22gg wrote:
> Okay, so I tried that, but the C++ package was already existent. I did
> update Visual Studio Community, but it gives me the same error.
> Also, the update added vcvarsall.bat, which was previously not in my
> installation, so I tried that with the Python build option, which gave me
> the same error as previously:
>
> ./ninja>python configure.py --bootstrap
> bootstrapping ninja...
> warning: A compatible version of re2c (>= 0.11.3) was not found; changes to
> src/*.in.cc will not affect your build.
> build.cc
> C:\Program Files (x86)\Microsoft Visual
> Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\cstdio(12): fatal
> error C1083: Cannot open include file: 'stdio.h': No such file or directory

Are you running from a Visual Studio Developer Command Prompt?

--Ben

iijj22gg

unread,
Jun 4, 2021, 11:47:28 AM6/4/21
to ninja-build
Yes I am, initialized by opening the file within Command Prompt.
Reply all
Reply to author
Forward
0 new messages