#include <iostream> int main(int argc, char** argv) { std::cout << "Hello world!\n"; std::cin.get(); } 

The hello.exe file, when launching, requires dll's, I can drop them into a folder, but is it possible to make hello.exe so that it runs and does not require libraries. Can I glue them together? Thank.

  • one
    It is necessary to link the static version of the dll. - VTT

1 answer 1

You are not quite correctly put the question.
"Linking" the DLL to the EXE will not work, but you can specify when building the application that you should link it not with dynamic, but with static libraries.

In Visual C ++, for example, this is done using the /MT key or a choice in the environment in the project properties - code generation - runtime library - multi-threaded / MT.