I'm building a cmake/ninja/clang-cl application with Visual Studio and it builds properly when I Generate Cache and Build All.
I can then open Visual Studio's powershell and run ninja clean
in the .../out/build/x64-Release
directory and re-build with Ctrl-Shift-B
. It works fine.
However, when I run ninja clean
and then ninja -v
in the terminal, it doesn't work. I get a link error:
lld-link: error: could not open 'msvcrt.lib': no such file or directory
lld-link: error: could not open 'oldnames.lib': no such file or directory
lld-link: error: could not open 'msvcprt.lib': no such file or directory
lld-link: error: could not open 'msvcprt.lib': no such file or directory
lld-link: error: could not open 'MSVCRT.lib': no such file or directory
lld-link: error: could not open 'OLDNAMES.lib': no such file or directory
I found these libraries here "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\lib\x64"
and I added them to my LIB environment variable. I assumed that would work since I had the same issue with not linking to kernel32.lib and got it working by adding "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x64"
to LIB. But it didn't.
My question:
Is ninja -v
the command executed by Visual Studio upon "Build All"? If so, why would Build All work, but the command ninja -v
from VS's powershell fail? If not, how can I tell what command Visual Studio is actually using (so I can replicate it)?
All I want is to build from emacs instead of Visual Studio, so I need a command to bind to a key binding; that command would usually be ninja -v
.
More info: when I run ninja -v
from powershell after a successful Build All, I get ninja: warning: bad deps log signature or version; starting over