Tony The Lion
Tony The Lion

Reputation: 63210

Do you get Debug Assertions under C++ when no CRT is installed?

When you have a Debug version of a C++ program running on an OS that has no VS or CRT installed, will you still get Debug Assertion error boxes?

The ones that say "Debug Assert Failed!".

Or will you only get them when the machine has certain components, such as CRT or Visual Studio installed?

Upvotes: 0

Views: 194

Answers (2)

Hans Passant
Hans Passant

Reputation: 941635

If you can get it to run, yes. Compiling with /MDd (the default) requires distributing the debug version of the dynamic CRT. It is not a redistributable component, shipping it anyway is a license violation. You could get around it by compiling with /MTd.

Of course, your user will have no idea what "Debug assertion failed" means and won't understand why Ignore doesn't work. Best avoided.

Upvotes: 1

the_mandrill
the_mandrill

Reputation: 30842

It depends how you've built your application. If you're dynamically linking to the debug CRT then it's very unlikely the user will have the debug CRTs on their system unless they're developers (and in fact you can't distribute it due to the licensing of VS). So in this case it won't even run. If you statically link to the CRT then the user will see the asserts if you've shipped them a debug build.

Upvotes: 2

Related Questions