fuzzyBatman
fuzzyBatman

Reputation: 41

Codeblocks run with Visual C++ developer tools

When i create a new project an alert box opens up asking

Multi-threaded Dynamic CRT mode or Multi-threaded Static CRT mode

what's the difference ?? And Explain..

Upvotes: 1

Views: 585

Answers (1)

Mario
Mario

Reputation: 36497

  • Dynamic: Dynamically link the runtime, which means your compiled files will be smaller, but require the Microsoft Visual C++ Runtime files to be installed. Depending on the Windows versions of the target system as well as other programs being installed there (and the version of VS you're using) it's likely that these are already installed, but you can never be sure, so you'll at least have to provide a download link in case your program doesn't run.
  • Static: Statically link the runtime, which means parts used are included in your compiled files. This will result in slightly larger files (depends on how many parts of the CRT you're using) and your code might be slightly faster. You won't need the runtime files to be present on the target system.

Which one to choose? Up to you.

  • If you're providing an installer that will take core of dependencies (like the CRT), using the dynamic version might be the better choice, especially when you're using multiple binary files (like executables and libraries). Otherwise you might essentially end up with duplicated code.

  • For a better "unzip and run" experience, I'd prefer using the static runtime.

  • You could as well use the dynamic runtime and provide a small "bootstrap" program, linked with the static runtime and checking whether the runtime is properly installed. If it isn't, it would download and install it prior to running the actual program.

Upvotes: 4

Related Questions