VC2015 and Windows 7 compatibility

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

VC2015 and Windows 7 compatibility

Gonzalo Garramuño
I compile on Windows 8.1.  I just found out that my program does not
work on Windows 7 after I upgraded my toolchain to VC2015. Users of my
program on Windows 7 get:

Missing DLL ms-api-win-core-libraryloader-l1-2-0.dll

After some digging, I found out that it can be because the use of SDK
Sets on win8.1.  And that perhaps setting the compiler compatibility to
WinXP should fix it.  However, I don't know how to do that from cmake.

Any ideas?

If you want to see my CMakeLists.txt, you can get the code with:

$ git clone ssh://[hidden email]/p/mrviewer/code mrviewer-code


--
Gonzalo Garramuño

--

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: VC2015 and Windows 7 compatibility

Elvis Stansvik
2017-09-19 17:50 GMT+02:00 Gonzalo Garramuño <[hidden email]>:
> I compile on Windows 8.1.  I just found out that my program does not work on
> Windows 7 after I upgraded my toolchain to VC2015. Users of my program on
> Windows 7 get:
>
> Missing DLL ms-api-win-core-libraryloader-l1-2-0.dll
>
> After some digging, I found out that it can be because the use of SDK Sets
> on win8.1.  And that perhaps setting the compiler compatibility to WinXP
> should fix it.  However, I don't know how to do that from cmake.

I also build on Win 8.1/MSVC 2015, targeting Windows 7+, and what I do
is basically:

if(WIN32)
    add_definitions(/D_WIN32_WINNT=0x0601) # Target Windows 7+

    set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
    set(CMAKE_INSTALL_UCRT_LIBRARIES ON)
    include(InstallRequiredSystemLibraries)
endif()

The /D_WIN32_WINNT=0x0601 is what ensures Windows 7 compatibility and
CMAKE_INSTALL_UCRT_LIBRARIES is what ensures Universal CRT libraries
like the one you mentioned gets installed alongside the application.

You'll end up with a truckload of such small DLLs, but AFAIK this is
what you need to do if you want to do app-local deployment of the
Universal CRT.

Hope that helps.

Elvis

>
> Any ideas?
>
> If you want to see my CMakeLists.txt, you can get the code with:
>
> $ git clone ssh://[hidden email]/p/mrviewer/code mrviewer-code
>
>
> --
> Gonzalo Garramuño
>
> --
>
> 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: VC2015 and Windows 7 compatibility

J Decker
you can just install the runtime redistributuable for 2015... 

 


On Tue, Sep 19, 2017 at 9:57 AM, Elvis Stansvik <[hidden email]> wrote:
2017-09-19 17:50 GMT+02:00 Gonzalo Garramuño <[hidden email]>:
> I compile on Windows 8.1.  I just found out that my program does not work on
> Windows 7 after I upgraded my toolchain to VC2015. Users of my program on
> Windows 7 get:
>
> Missing DLL ms-api-win-core-libraryloader-l1-2-0.dll
>
> After some digging, I found out that it can be because the use of SDK Sets
> on win8.1.  And that perhaps setting the compiler compatibility to WinXP
> should fix it.  However, I don't know how to do that from cmake.

I also build on Win 8.1/MSVC 2015, targeting Windows 7+, and what I do
is basically:

if(WIN32)
    add_definitions(/D_WIN32_WINNT=0x0601) # Target Windows 7+

    set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION ".")
    set(CMAKE_INSTALL_UCRT_LIBRARIES ON)
    include(InstallRequiredSystemLibraries)
endif()

The /D_WIN32_WINNT=0x0601 is what ensures Windows 7 compatibility and
CMAKE_INSTALL_UCRT_LIBRARIES is what ensures Universal CRT libraries
like the one you mentioned gets installed alongside the application.

You'll end up with a truckload of such small DLLs, but AFAIK this is
what you need to do if you want to do app-local deployment of the
Universal CRT.

Hope that helps.

Elvis

>
> Any ideas?
>
> If you want to see my CMakeLists.txt, you can get the code with:
>
> $ git clone ssh://ggarra13@....net/p/mrviewer/code mrviewer-code
>
>
> --
> Gonzalo Garramuño
>
> --
>
> 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


--

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: VC2015 and Windows 7 compatibility

Gonzalo Garramuño


El 19/09/2017 a las 15:19, J Decker escribió:
> you can just install the runtime redistributuable for 2015...
>
> https://www.microsoft.com/en-us/download/details.aspx?id=48234
Unfortunately, that does not have the required ms-api-win-core* DLLs.  
It is something that changed with v8.0 of windows.  Elvis solution seems
like it should work.  I am awaiting an answer from my beta testers.

--
Gonzalo Garramuño

--

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: VC2015 and Windows 7 compatibility

Robert Maynard
I believe if you want to compile with XP support you can also specify
that as part of the Toolset string.

So from a clean build directory: make -G "Visual Studio 14 2015" -T v140_xp

On Tue, Sep 19, 2017 at 5:22 PM, Gonzalo Garramuño <[hidden email]> wrote:

>
>
> El 19/09/2017 a las 15:19, J Decker escribió:
>>
>> you can just install the runtime redistributuable for 2015...
>>
>> https://www.microsoft.com/en-us/download/details.aspx?id=48234
>
> Unfortunately, that does not have the required ms-api-win-core* DLLs.  It is
> something that changed with v8.0 of windows.  Elvis solution seems like it
> should work.  I am awaiting an answer from my beta testers.
>
>
> --
> Gonzalo Garramuño
>
> --
>
> 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: VC2015 and Windows 7 compatibility

Elvis Stansvik
In reply to this post by Gonzalo Garramuño
2017-09-19 23:22 GMT+02:00 Gonzalo Garramuño <[hidden email]>:

>
>
> El 19/09/2017 a las 15:19, J Decker escribió:
>>
>> you can just install the runtime redistributuable for 2015...
>>
>> https://www.microsoft.com/en-us/download/details.aspx?id=48234
>
> Unfortunately, that does not have the required ms-api-win-core* DLLs.  It is
> something that changed with v8.0 of windows.  Elvis solution seems like it
> should work.  I am awaiting an answer from my beta testers.

What I forgot to say is that you of course need the Universal CRT DLLs
available somewhere on your build system where the CMake code behind
CMAKE_INSTALL_UCRT_LIBRARIES will find them.

I can't remember exactly what I did, but I do remember a fiddled
around a bit to get them installed without having to install a full
SDK, because the SDK that they were part of interfered with my build
somehow. I _think_ that I took some download from Microsoft that
contained multiple installers, and extracted that to get just the
installer for the Universal CRT DLLs. Because I couldn't find just the
Universal CRT installer as a separate download at Microsoft.

I'll try to dig out/remember what I did exactly when I'm back at work
with access to the Windows build box.

Elvis

>
>
> --
> Gonzalo Garramuño
>
> --
>
> 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: VC2015 and Windows 7 compatibility

Elvis Stansvik
2017-09-20 7:53 GMT+02:00 Elvis Stansvik <[hidden email]>:

> 2017-09-19 23:22 GMT+02:00 Gonzalo Garramuño <[hidden email]>:
>>
>>
>> El 19/09/2017 a las 15:19, J Decker escribió:
>>>
>>> you can just install the runtime redistributuable for 2015...
>>>
>>> https://www.microsoft.com/en-us/download/details.aspx?id=48234
>>
>> Unfortunately, that does not have the required ms-api-win-core* DLLs.  It is
>> something that changed with v8.0 of windows.  Elvis solution seems like it
>> should work.  I am awaiting an answer from my beta testers.
>
> What I forgot to say is that you of course need the Universal CRT DLLs
> available somewhere on your build system where the CMake code behind
> CMAKE_INSTALL_UCRT_LIBRARIES will find them.
>
> I can't remember exactly what I did, but I do remember a fiddled
> around a bit to get them installed without having to install a full
> SDK, because the SDK that they were part of interfered with my build
> somehow. I _think_ that I took some download from Microsoft that
> contained multiple installers, and extracted that to get just the
> installer for the Universal CRT DLLs. Because I couldn't find just the
> Universal CRT installer as a separate download at Microsoft.
>
> I'll try to dig out/remember what I did exactly when I'm back at work
> with access to the Windows build box.
I now remember what I did: I downloaded the Windows 10 SDK installer
(winsdksetup.exe) from:

    https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk

But instead of going ahead and installing the full SDK, which broke
something for me [1], I picked the installation option:

    (o) Download the Windows Software Development Kit .... for
installation on a separate computer

This will simply download all the separate installers that constitute
the SDK and put them in the specified download path.

Among them is:

    <DownloadPath>/Installers/Universal CRT Redistributable-x86_en-us.msi

And it is this specific installer I ran to get just the Universal CRT
DLLs installed, without having to install the full Windows 10 SDK.

I haven't been able to find this installer as a direct download from
Microsoft, only as part of the Windows 10 SDK.

Hope that helps. I'm attaching a screenshot showing all the stuff I
have installed on my Win 8.1 builder. Note that I'm using Microsoft
Visual C++ Build Tools (2015), to avoid having to install the full
IDE.

Elvis

[1] I can't remember what broke right now, but I'm using the Win 8.1
SDK, so probably something interfered.

>
> Elvis
>
>>
>>
>> --
>> Gonzalo Garramuño
>>
>> --
>>
>> 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

installed.png (77K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: VC2015 and Windows 7 compatibility

Gonzalo Garramuño
In reply to this post by Robert Maynard


El 19/09/2017 a las 18:28, Robert Maynard escribió:
> I believe if you want to compile with XP support you can also specify
> that as part of the Toolset string.
>
> So from a clean build directory: make -G "Visual Studio 14 2015" -T v140_xp
>
Unfortunately I am using Makefiles ( Ninja ) which do not suppport the
toolset command.

--
Gonzalo Garramuño

--

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: VC2015 and Windows 7 compatibility

Gonzalo Garramuño
In reply to this post by Elvis Stansvik


El 20/09/2017 a las 04:44, Elvis Stansvik escribió:

> 2017-09-20 7:53 GMT+02:00 Elvis Stansvik <[hidden email]>:
>> 2017-09-19 23:22 GMT+02:00 Gonzalo Garramuño <[hidden email]>:
>>>
>>> El 19/09/2017 a las 15:19, J Decker escribió:
>>>> you can just install the runtime redistributuable for 2015...
>>>>
>>>> https://www.microsoft.com/en-us/download/details.aspx?id=48234
>>> Unfortunately, that does not have the required ms-api-win-core* DLLs.  It is
>>> something that changed with v8.0 of windows.  Elvis solution seems like it
>>> should work.  I am awaiting an answer from my beta testers.
>> What I forgot to say is that you of course need the Universal CRT DLLs
>> available somewhere on your build system where the CMake code behind
>> CMAKE_INSTALL_UCRT_LIBRARIES will find them.
Thanks, Elvis.  That helps.  I was able to get a Win64 build running on
my Win7 (sans SP1) box once all the api-ms-win-core* packages were
disted.   The Win32 build of my program cannot start with an
api-ms-win-core-crt-*.dll error.

However since then I read that those api DLLs are not part of the
Microsoft Runtime and as such cannot legally be disted and they
shouldn't in any case for technical reasons (Microsoft might want to
change them from version to version).

I am now trying to get a Windows7 SP1 box for myself to try further.

--
Gonzalo Garramuño

--

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: VC2015 and Windows 7 compatibility

Elvis Stansvik
2017-09-21 0:20 GMT+02:00 Gonzalo Garramuño <[hidden email]>:

>
>
> El 20/09/2017 a las 04:44, Elvis Stansvik escribió:
>>
>> 2017-09-20 7:53 GMT+02:00 Elvis Stansvik <[hidden email]>:
>>>
>>> 2017-09-19 23:22 GMT+02:00 Gonzalo Garramuño <[hidden email]>:
>>>>
>>>>
>>>> El 19/09/2017 a las 15:19, J Decker escribió:
>>>>>
>>>>> you can just install the runtime redistributuable for 2015...
>>>>>
>>>>> https://www.microsoft.com/en-us/download/details.aspx?id=48234
>>>>
>>>> Unfortunately, that does not have the required ms-api-win-core* DLLs.
>>>> It is
>>>> something that changed with v8.0 of windows.  Elvis solution seems like
>>>> it
>>>> should work.  I am awaiting an answer from my beta testers.
>>>
>>> What I forgot to say is that you of course need the Universal CRT DLLs
>>> available somewhere on your build system where the CMake code behind
>>> CMAKE_INSTALL_UCRT_LIBRARIES will find them.
>
> Thanks, Elvis.  That helps.  I was able to get a Win64 build running on my
> Win7 (sans SP1) box once all the api-ms-win-core* packages were disted.
> The Win32 build of my program cannot start with an api-ms-win-core-crt-*.dll
> error.

Alright, glad you've made some progress. I only do x64 builds, so I
haven't tried to get it working on x86.

>
> However since then I read that those api DLLs are not part of the Microsoft
> Runtime and as such cannot legally be disted and they shouldn't in any case
> for technical reasons (Microsoft might want to change them from version to
> version).

Hm, it would surprise me if Microsoft made app-local deployment of the
Universal CRT illegal. I know Microsoft discourages app-local
deployment, preferring other means of doing it that allows for the
DLLs to be updated centrally, but making it muddy legally would be
another level of stupid.

See the initial blog post about the Universal CRT here:
https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/
, and especially the "Updated September 11, 2015" section in red. So I
think it is supported, just discouraged.

Elvis

>
> I am now trying to get a Windows7 SP1 box for myself to try further.
>
> --
> Gonzalo Garramuño
>
--

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