CMake with VS2015 C++ Build Tools and missing ucrtbased.dll

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

CMake with VS2015 C++ Build Tools and missing ucrtbased.dll

Roger Leigh
I'm doing some initial testing of CMake 3.6.0 with the newly-released
Visual Studio 2015 Update 3 C++ Build Tools
(http://landinghub.visualstudio.com/visual-cpp-build-tools).  I.e. the
standalone compiler without the IDE.

I'm configuring with:

   cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug|Release [in an x64 native
tools command prompt]
   cmake -G "Visual Studio 14 2015 Win64"

And then building and running the unit tests with ctest.

With a release build using either generator, all the tests run and pass.
  With a debug build using either generator, every test fails with the
message:

<TestName.exe> - System Error
The program can't start because ucrtbased.dll is missing from your
computer.  Try reinstalling the program to fix this problem.

The DLL *is* installed on the system:
/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows
Kits/10/ExtensionSDKs/Microsoft.UniversalCRT.Debug/10.0.10240.0/Redist/Debug/arm/ucrtbased.dll
/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows
Kits/10/ExtensionSDKs/Microsoft.UniversalCRT.Debug/10.0.10240.0/Redist/Debug/arm64/ucrtbased.dll
/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows
Kits/10/ExtensionSDKs/Microsoft.UniversalCRT.Debug/10.0.10240.0/Redist/Debug/x64/ucrtbased.dll
/cygdrive/c/Program Files (x86)/Microsoft SDKs/Windows
Kits/10/ExtensionSDKs/Microsoft.UniversalCRT.Debug/10.0.10240.0/Redist/Debug/x86/ucrtbased.dll
/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/arm/ucrt/ucrtbased.dll
/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/arm64/ucrt/ucrtbased.dll
/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/x64/ucrt/ucrtbased.dll
/cygdrive/c/Program Files (x86)/Windows Kits/10/bin/x86/ucrt/ucrtbased.dll

And the environment:
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\INCLUDE;C:\Program Files (x86)\Windows
Kits\10\include\10.0.10240.0\ucrt;C:\Program Files (x86)\Windows
Kits\8.1\include\shared;C:\Program Files (x86)\Windows
Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt;
LIB=C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\LIB\amd64;C:\Program Files (x86)\Windows
Kits\10\lib\10.0.10240.0\ucrt\x64;C:\Program Files (x86)\Windows
Kits\8.1\lib\winv6.3\um\x64;
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\LIB\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\Microsoft.NET\Framework64\;References\CommonConfiguration\Neutral;\Microsoft.VCLibs\14.0\References\CommonConfiguration\neutral;
Path=c:\opt\bin;C:\Program Files (x86)\MSBuild\14.0\bin\amd64;C:\Program
Files (x86)\Microsoft Visual Studio
14.0\VC\BIN\amd64;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Windows\Microsoft.NET\Framework64\;C:\Program
Files (x86)\Windows Kits\8.1\bin\x64;C:\Program Files (x86)\Windows
Kits\8.1\bin\x86;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files (x86)\PuTTY\;C:\Program Files (x86)\Windows Kits\8.1\Windows
Performance Toolkit\;C:\Program
Files\CMake\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\rleigh\AppData\Local\Programs\Git\cmd

But for some reason it's not on the PATH while the release version of
the ucrtbase.dll is.  I'm not sure if this is a bug in the VS command
prompt environment--"Windows Kits/8.1/bin/x64" is on the path, but not
"Windows Kits/10/bin/x64", while both are in the include path...  Could
this be a bug in the VS command prompt environment?  Or is this more
likely to be a cmake issue?

The code in question is https://github.com/rleigh-dundee/xercesc-cmake 
(I'm working on a conversion of the autotools and VS project files to a
cmake build), but I suspect this would happen with any project which
wants to run a debug executable.


Thanks,
Roger
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
TT
Reply | Threaded
Open this post in threaded view
|

Re: CMake with VS2015 C++ Build Tools and missing ucrtbased.dll

TT
I'm having the same problem with "missing" ucrtbased.dll even though it is present in all the platforms under C:\Program Files (x86)\Windows Kits\10\bin\

I have tried reinstalling the Windows SDK and the Microsoft C++ Build Tools (2015).

Here are some related links with no solutions:

1)
https://social.msdn.microsoft.com/Forums/en-US/25a64cd8-1482-4cc4-9dbb-3a420c7a31be/visual-c-build-tools-doesnt-install-ucrtbaseddll?forum=vssetup
 - I can't reinstall Visual Studio, because I never installed it, only the aforementioned Build Tools.

2)
http://stackoverflow.com/questions/33743493/why-visual-studio-2015-cant-run-exe-file-ucrtbased-dll/41970093
 - This one says "This problem is from VS 2015 silently failing to copy ucrtbased.dll (debug) and ucrtbase.dll (release) into the appropriate system folders.."

Here is a recent answer that seems to be getting at the root cause of the problem:
http://stackoverflow.com/a/35466136/3066295

Which links to this,
https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/

Which has a comment part way down that says "When debugging on machines that do not have the Windows SDK installed, we would recommend copying the debug Universal CRT (ucrtbased.dll) app-locally with your app, or copying it to the system directory yourself."

So the solution seems to be install either the Windows SDK (10 not just 8.1 as I have) or copy the ucrtbased.dll to C:\Windows\System32
Reply | Threaded
Open this post in threaded view
|

Re: CMake with VS2015 C++ Build Tools and missing ucrtbased.dll

J Decker
or copy ucrtbased.dll into your program directory...
ucrtbaseD.dll is the debug version, and is only installed with the compilers, and not just the windows kits(?).


On Fri, Mar 10, 2017 at 8:47 AM, TT <[hidden email]> wrote:
I'm having the same problem with "missing" ucrtbased.dll even though it is
present in all the platforms under C:\Program Files (x86)\Windows
Kits\10\bin\

I have tried reinstalling the Windows SDK and the Microsoft C++ Build Tools
(2015).

Here are some related links with no solutions:

1)
https://social.msdn.microsoft.com/Forums/en-US/25a64cd8-1482-4cc4-9dbb-3a420c7a31be/visual-c-build-tools-doesnt-install-ucrtbaseddll?forum=vssetup
 - I can't reinstall Visual Studio, because I never installed it, only the
aforementioned Build Tools.

2)
http://stackoverflow.com/questions/33743493/why-visual-studio-2015-cant-run-exe-file-ucrtbased-dll/41970093
 - This one says "This problem is from VS 2015 silently failing to copy
ucrtbased.dll (debug) and ucrtbase.dll (release) into the appropriate system
folders.."

Here is a recent answer that seems to be getting at the root cause of the
problem:
http://stackoverflow.com/a/35466136/3066295

Which links to this,
https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/

Which has a comment part way down that says "When debugging on machines that
do not have the Windows SDK installed, we would recommend copying the debug
Universal CRT (ucrtbased.dll) app-locally with your app, or copying it to
the system directory yourself."

So the solution seems to be install either the Windows SDK (10 not just 8.1
as I have) or copy the ucrtbased.dll to C:\Windows\System32



--
View this message in context: http://cmake.3232098.n2.nabble.com/CMake-with-VS2015-C-Build-Tools-and-missing-ucrtbased-dll-tp7593931p7595151.html
Sent from the CMake mailing list archive at Nabble.com.
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: CMake with VS2015 C++ Build Tools and missing ucrtbased.dll

Roger Leigh
In reply to this post by TT
On 10/03/2017 16:47, TT wrote:
> I'm having the same problem with "missing" ucrtbased.dll even though it is
> present in all the platforms under C:\Program Files (x86)\Windows
> Kits\10\bin\
>
> I have tried reinstalling the Windows SDK and the Microsoft C++ Build Tools
> (2015).

 From Andrew Pardoe: "It turns out that the Build Tools SKU only
installs the universal CRT for developers on Windows 10. We should have
had it install on all OS. We'll fix this in the next release."  From a
private reply from this thread:
https://www.reddit.com/r/cpp/comments/4r8n41/what_are_some_reasons_why_visual_studio_seems_so/d51sh2f/?context=3

It's a bit broken.  The 2017 version seems OK though.


Regards,
Roger
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake