Vcpkg: "vcpkg install" at VS2017 Command Prompt fails - No CMAKE_C_COMPILER could be found.

Created on 15 Mar 2017  路  7Comments  路  Source: microsoft/vcpkg

"vcpkg install" fails when run from "Developer Command Prompt for VS 2017"

---//---
`C:\opt\vcpkg>vcpkg install boost
-- CURRENT_INSTALLED_DIR=C:/opt/vcpkg/installed/x86-windows
-- DOWNLOADS=C:/opt/vcpkg/downloads
-- CURRENT_PACKAGES_DIR=C:/opt/vcpkg/packages/zlib_x86-windows
-- CURRENT_BUILDTREES_DIR=C:/opt/vcpkg/buildtrees/zlib
-- CURRENT_PORT_DIR=C:/opt/vcpkg/ports/zlib/.
-- Using cached C:/opt/vcpkg/downloads/zlib1211.tar.gz
-- Testing integrity of cached file...
-- Testing integrity of cached file... OK
-- Extracting done
-- Configuring x86-windows-rel
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:14 (message):
Command failed: C:/opt/vcpkg/downloads/cmake-3.8.0-rc1-win32-x86/bin/cmake.exe;C:/opt/vcpkg/buildtrees/zlib/src/zlib-1.2.11;-DSK
IP_INSTALL_FILES=ON;-DBUILD_SHARED_LIBS=ON;-DCMAKE_CXX_FLAGS= /DWIN32 /D_WINDOWS /W3 /utf-8 /GR /EHsc /MP;-DCMAKE_C_FLAGS= /DWIN32 /
D_WINDOWS /W3 /utf-8 /MP;-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON;-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON;-DCMAKE_FIND_PACKAGE_NO_S
YSTEM_PACKAGE_REGISTRY=ON;-DBoost_COMPILER=-vc140;-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE;-DCMAKE_VERBOSE_MAKEFILE=ON;-DCMAKE_
TOOLCHAIN_FILE=C:/opt/vcpkg/triplets/x86-windows.cmake;-DCMAKE_CXX_FLAGS_RELEASE=/MD /O2 /Oi /Gy /DNDEBUG /Zi;-DCMAKE_C_FLAGS_RELEAS
E=/MD /O2 /Oi /Gy /DNDEBUG /Zi;-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF;-DCMAKE_EXE_LINKER_FLAGS
_RELEASE=/DEBUG /INCREMENTAL:NO /OPT:REF /OPT:ICF;-G;Visual Studio 15 2017;-DCMAKE_BUILD_TYPE=Release;-DCMAKE_PREFIX_PATH=C:/opt/vcp
kg/installed/x86-windows;-DCMAKE_INSTALL_PREFIX=C:/opt/vcpkg/packages/zlib_x86-windows
Working Directory: C:/opt/vcpkg/buildtrees/zlib/x86-windows-rel
See logs for more information:
C:\opt\vcpkg\buildtrees\zlib\config-x86-windows-rel-out.log
C:\opt\vcpkg\buildtrees\zlib\config-x86-windows-rel-err.log

Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:98 (vcpkg_execute_required_process)
ports/zlib/portfile.cmake:10 (vcpkg_configure_cmake)
scripts/ports.cmake:73 (include)

Error: Building package zlib:x86-windows failed with: BUILD_FAILED
Please ensure sure you're using the latest portfiles with .\vcpkg update, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: zlib:x86-windows
Vcpkg version: 0.0.76-3e5a32db9bce1a6f3b296adbf51f1945af6b0ffc

Additionally, attach any relevant sections from the log files above.

C:\opt\vcpkg>`
---//---

---//---
C:\opt\vcpkg\buildtrees\zlib\config-x86-windows-rel-out.log
-- The C compiler identification is unknown
-- Configuring incomplete, errors occurred!
See also "C:/opt/vcpkg/buildtrees/zlib/x86-windows-rel/CMakeFiles/CMakeOutput.log".
See also "C:/opt/vcpkg/buildtrees/zlib/x86-windows-rel/CMakeFiles/CMakeError.log".
---//---

---//---
C:\opt\vcpkg\buildtrees\zlib\config-x86-windows-rel-err.log ===
CMake Error at CMakeLists.txt:4 (project):
No CMAKE_C_COMPILER could be found.
---//---

vcpkg-bug

All 7 comments

Hello, I have encountered the same error a few days ago, have you run the ".\vcpkg integrate install" before installing your first package? If it is the case, start a fresh clone of vcpkg, install your package(s), and then integrate install (further package installations would not trigger this error).

Thanks for the suggestion. I tried that but got the same result.

I ran into the same problem. Digging deeper into the logs it seems the linking of zlib fails.

from C:\Users\User\Sources\vcpkg\buildtrees\zlib\x86-windows-rel\CMakeFiles\CMakeError.log
Section Link:
C:\Program Files (x86)\Microsoft Visual Studio2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\link.exe /ERRORREPORT:QUEUE /OUT:".\CompilerIdC.exe" /INCREMENTAL:NO /NOLOGO /LIBPATH:"C:\Users\user\Sources\vcpkg\installed\x86-windows\debuglib" /LIBPATH:"C:\Users\user\Sources\vcpkg\installed\x86-windows\debuglib\manual-link" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib "C:\Users\user\Sources\vcpkg\installed\x86-windows\debuglib*.lib" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:".\CompilerIdC.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\CompilerIdC.lib" /MACHINE:X86 /SAFESEH Debug\CMakeCCompilerId.obj
LINK : fatal error LNK1104: cannot open file 'ucrtd.lib'

Is this the same for you herbthompson?

ucrtd.lib is supplied by the windows 10 dev kit and is for my system in C:\Program Files (x86)Windows Kits\10\Lib\10.0.14393.0\ucrt[x64|x86]\'ucrtd.lib, both of which I added to my path variable for testing. Still fails.

The last update fixed this problem for me.

Hope it is the same for you @herbthompson ?

Thanks for the info @derkestrel . The new version works for me too.

Should be fixed in the latest versions. Please let us know if you continue to have issues!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tzbo picture tzbo  路  3Comments

cskrisz picture cskrisz  路  3Comments

husseinalihazime picture husseinalihazime  路  3Comments

cjvaijo picture cjvaijo  路  3Comments

F0I0l0I0P picture F0I0l0I0P  路  3Comments