-1

I thought if you compile a Visual-studio 2013 Win32 project using /MT Code Generation->Runtime library then it will automatically package all dependency dll's - including 3rd party dll's - into the executable?

Currently certain users get an error when running my .exe. Its related to not having a 3rd party dll (OpenSSL):

The program can't start because LIBEAY32.dll is missing from your computer

This error has occurred for users using my .exe on Windows 10 OS's. How can I ensure all dependency dll's are packaged into my .exe?

I currently compile my application on my 64bit Windows 8.1 OS. The win32 visual-studio project is compiled using the following project properties:

  • Character Set: Unicode char set
  • Use of MFC: Use standard windows libraries
  • Whole Program Optimisation: Use Link Time Code Generation
  • Debug info format: none
  • Code Generation->Runtime library: /MT
Sosian
  • 622
  • 11
  • 28
Merl
  • 131
  • 1
  • 14

2 Answers2

1

/MT indicates that you are using multithread, static version of the run-time library. This doesn't affect third party dependency, e.g. OpenSSL is still linked dynamically.

To check your dll's dependency I prefer Dependency Walker tool. It will show if some of dependency is missed.

To ensure all dependency linked into your .exe file use static linking for all your third party dependency, e.g. for OpenSSL you should use libeay32MT.lib library.

Nikita
  • 6,270
  • 2
  • 24
  • 37
0

Nikita is right, use Dependency Walker and I'd add that you're missing some knowledge about what a DLL really is. No offence meant, I know dlls can be a pita. What is a DLL?

By definition a DLL is not included in your .exe but it is loaded at runtime and could be shared amongst several applications. If you want to include it in your .exe it will require some extra non trivial work to embed them into your exe, unpack and load at runtime. See this post

I'd suggest to use an installer instead, much easier to handle! Just create an installer (you know the click click click "yes-yes-I agree-Ok-Done" wizard installer) that will include your .exe and all needed dependency files. As a reference Inno setup is quite great.

Community
  • 1
  • 1
RDK
  • 88
  • 2
  • 9