Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
initialization segment must not change during translation unit
Remarks
Possible causes:
#pragma init_segpreceded by segment initialization code#pragma init_segpreceded by another#pragma init_seg
To resolve, move the segment initialization code to the beginning of the module. If multiple areas must be initialized, move them to separate modules.
Example
The following example generates C2356:
// C2356.cpp
#pragma warning(disable : 4075)
int __cdecl myexit(void (__cdecl *)());
int __cdecl myexit2(void (__cdecl *)());
#pragma init_seg(".mine$m",myexit)
#pragma init_seg(".mine$m",myexit2) // C2356