More efficient way to collect all DLL in a project

496 views Asked by At

I want export a executable file to others and they can play the game with a click, but when I click the executable file it immediately shutdown. I think it missed some DLL file to be able to run. So I checked the build log.

'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'.
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\win32u.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\d3d11.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\D3DCompiler_47.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\gdi32full.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\ucrtbase.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\msvcp_win.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\dxgi.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\combase.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\cryptsp.dll'. 
'Pacman.exe' (Win32): Loaded 'C:\Windows\System32\msvcp140.dll'. 

.......and so on.

Is there only one way that manually copies all files mentioned above?

Project Link

1

There are 1 answers

0
Chuck Walbourn On

The vast majority of those files are just part of the Windows operating system.

msvcp140.dll is part of the Visual C++ Runtime. You can deploy these side-by-side (i.e. xcopy style deployment). See Microsoft Docs. Exactly which files you need depends on which version if Visual C++ you are using to build the game.

  • vcruntime140.dll

  • msvcp140.dll

  • concrt140.dll (only used for Windows XP)

  • vccorlib140.dll (only used for C++/CX)

  • msvcp140_1.dll: (added in VS 2017) C++17 memory_resource

  • msvcp140_2.dll: (added in VS 2017 15.7) C++17 mathematical special functions

  • vcruntime140_1.dll: (added in VS 2019) __CxxFrameHandler4 for FH4 (x64 only)

  • msvcp140_codecvt_ids.dll: (added in VS 2019 16.2) fixes for codecvt for char8_t, char16_t, and char32_t.

The D3DCompiler_47.dll HLSL compiler depends on your minimum operating system. Windows 8.1 and Windows 10 already include it. If you need to support Windows 7 SP1 or Windows 8.0, you can include it side-by-side with your game. See this blog post.