Kind of a simple question, but when I compile an application I’d like to make it so the user doesn’t need all the dll’s/shared objects and can just have one standalone executable. How do I do this? Either in a Makefile or in CodeBlocks’ settings.
Share
If you have the source, or if you have the right kind of .lib file, you can statically link. (Note, however, that DLLs also sometimes come with a .lib file, and that file is just a shim for calling into the DLL.) If you can statically link, you’ll have a single executable.
Other than that, make an install directory and put the DLL into the same directory as the executable. That’s the easiest way.
There’s probably a trick where you could inject the DLL into executable and write a custom loader that would act like a DLL, but you really don’t want to go down that path.