Edit

Share via


Compiler Error C2357

'identifier' : must be a function of type 'type'

Your code declares a version of the atexit function that does not match the version declared internally by the compiler. Declare atexit as follows:

int __cdecl atexit(void (__cdecl *)());

For more information, see init_seg.

The following sample generates C2357:

// C2357.cpp
// compile with: /c
// C2357 expected
#pragma warning(disable : 4075)
// Uncomment the following line to resolve.
// int __cdecl myexit(void (__cdecl *)());
#pragma init_seg(".mine$m",myexit)