ID Number: Q75268
6.00 6.00a 6.00ax | 6.00 6.00a
MS-DOS | OS/2
Summary:
Beginning with Microsoft C version 6.0, it is no longer necessary to
define _acrtused in a module to avoid pulling in the C run-time
library code at link time.
More Information:
With Microsoft C Compilers earlier than version 6.0, the compiler
would automatically generate an external reference to a symbol called
_acrtused. This was resolved in the run-time library by the startup
code and was required to make an executable that used the C run-time
code.
However, if you were creating a dynamic-link library (DLL) and you did
not want or need to use the C run-time code, you had to declare and
initialize an extern int called _acrtused in your code to resolve the
reference. If you forgot to do this, you may have had problems linking
or, at the very least, some unused code would be included in your DLL.
Beginning with C 6.0, the compiler generates a reference to _acrtused
only if the module it is compiling contains main(), winmain(), or
libmain(). If you avoid these function names, you no longer have to
worry about the run-time code being linked in unless you explicitly
make a call to it. Enabling stack checking or pointer checking causes
the startup code to be brought in as well.
As an aside, if for some reason you have moved your main module to a
library, you may find that your program does not link in the startup
code and the linker reports an error about no starting address. The
reason for this is simple. Unless you explicitly call one of the
functions in the run-time code that requires startup support (and has
therefore defined a reference to _acrtused) or you make a call to a
function in the main module, the linker has no way of knowing that the
startup code is required and does not pull it from the library.
Additional reference words: 6.0 6.00 6.0a 6.00a 6.0ax 6.00ax