ethereum / aleth

Aleth – Ethereum C++ client, tools and libraries
GNU General Public License v3.0
3.96k stars 2.17k forks source link

Windows - runtime libraries "vcruntime140.dll" etc.. (Documentation) #3183

Open bobsummerwill opened 8 years ago

bobsummerwill commented 8 years ago

From @geregtigheid on June 28, 2016 20:51

I see that ethereum release "1.2.9" contain ethminer, that successfully start without "vcruntime140.dll" and other libraries from Visual C++ Redistributable Packages for Visual Studio 2013.

I need to make the same, but I can't to force ethminer launch without installing VC++ Redistributable. Compiling ethminer with this instruction: http://www.ethdocs.org/en/latest/ethereum-clients/cpp-ethereum/building-from-source/windows.html#pre-requisites

I tried to change linker options on "/nodefaultlib:vcruntime.lib", compiler options from "/MD" to "/MT", but then build fails..

The only requirement is to compile standalone executable - which works without any installation. I tried to put "vcruntime140.dll" in work directory, but after it ask for "api-ms-win-crt-runtime-l1-1-0.dll" which doesn't work, if copied from another PC..

Copied from original issue: ethereum/webthree-umbrella#601

bobsummerwill commented 8 years ago

You do need to run those VC++ redistributables, yes.

Looks like we had that documented for the binaries - http://ethdocs.org/en/latest/ethereum-clients/cpp-ethereum/installing-binaries/windows-installer.html - but not the source docs.

I will update those. Thanks for the heads-up.

bobsummerwill commented 8 years ago

From @geregtigheid on June 29, 2016 15:43

Thanks for answer. But your binaries already running without VC++ redistributables, I need to do the same, only question - how? Maybe you use another compiler etc..?

bobsummerwill commented 8 years ago

The way it works is that the executables have a runtime dependency on VC++ runtime DLLs.

If you have Visual Studio installed on your machine (which you must have to build from source) then you will have those DLLs already.

If you are using those executables on a fresh machine then those DLLs will be missing (which is what the redist installer fixes).

The best way of solving this is for the Windows installer to include copies of those DLLs in the same directory as the EXE, and those will be used rather than relying on a global install. I tried to do exactly that many hours, but couldn't work out quite how through the rats-nest of CMake, NSIS, Jenkins and more in that chain.

So yeah - just run the VC redist and you'll be fine.

The ZIP has those copies. It's just the installer which is missing them. It does include that redist installer, though, I believe.

bobsummerwill commented 8 years ago

From @geregtigheid on June 30, 2016 14:0

include copies of those DLLs in the same directory as the EXE

I tried, but without success. First DLL it ask was "VCRUNTIME140.dll", then "api-ms-win-crt-runtime-l1-1-0.dll", but after copying this files from Visual Studio PC to fresh machine, ethminer start with error "entry point ucrtbase.terminate didn't found in api-ms-win-crt-runtime-l1-1-0.dll".

Only way to make workable api-ms-win-crt-runtime-l1-1-0.dll is to install it from VC redist, not copy from another machine.. but I'm seaching how to start myself compiled ethminer on fresh machine without running VC redist install. Only way - to use your binaries from release, but I need modified ethminer :/

bobsummerwill commented 8 years ago

Sounds like your machine is screwed up. Maybe this?

https://support.tidal.com/hc/en-us/articles/206881749-The-program-can-t-start-because-api-ms-win-crt-runtime-l1-1-0-dll-is-missing

So perhaps it is unavoidable, and you need to run that re-dist. I think you should be able to do a silent command-line install of it, though, like so ...

http://asawicki.info/news_1597_installing_visual_c_redistributable_package_from_command_line.html

bobsummerwill commented 8 years ago

From @geregtigheid on June 30, 2016 21:41

yeah, silent VC redist install should work for me.. Will perform another EXE for initiating VC redis setup and running ethminer. This is suitable command:

\vcredist_x64.exe /q /norestart

Thank you a lot for your time and answers. Best regards.

bobsummerwill commented 8 years ago

No problem, @geregtigheid!

Good for me to know that the VC++ redist install is not avoidable :-)

I'll just reopen this issue to track the documentation TODO.