Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install ninja-build for C++

Tags:

c++

ninja

https://github.com/ninja-build/ninja/releases

I have downloaded the ninja-win.zip folder and extracted it. When I open it, there is a single .exe file in the entire folder. When I double click it a cmd window flashes for a split second. I have also tried running it as administrator, but the same thing happens. What I don't understand is, what am I expected to do with this .exe file?

like image 829
Senyokbalgul Avatar asked Mar 10 '17 05:03

Senyokbalgul


3 Answers

You must open a terminal (cmd.exe on Windows) and type something like ninja -f /path/to/buld/file. You may also wish to modify the PATH environment variable so that Windows knows where to find the Ninja executable, depending on your setup.

like image 187
JeremiahB Avatar answered Oct 17 '22 22:10

JeremiahB


You can simple download ninja.exe file from this Link

https://github.com/ninja-build/ninja/releases

After that you just have to add the path to your ninja.exe file to your windows environment variables and then you can use ninja commands from anywhere in windows.

like image 5
Abdul ahad Avatar answered Oct 17 '22 22:10

Abdul ahad


1. Open cmd in your Project Directory

2. There are guides on the internet on where to save the Ninja.exe so that it'll be callable in Cmd without specifying directory. Either follow them or:

i, Specify Directory when Calling Ninja. Putting "ninja" in Cmd actually calls Ninja.exe and is the same as something like "C:\users\user1\downloads\Ninja". or:

ii, Save Ninja.exe in the same directory as Project.

3. proceed with rest of the command.

Therefore the Final Command would be:

"C:\users\user\downloads\Ninja.exe" -f "D:\Projects\Project1"
like image 3
RishiNandha Vanchi Avatar answered Oct 17 '22 21:10

RishiNandha Vanchi