Compiler Error C2341

section name : segment must be defined using #pragma data_seg or code_seg prior to use

You referred to a section in a #pragma or __declspec(allocate()) statement before defining the section with a #pragma code_seg or #pragma data_seg.

For example, the compiler would generate this error if the following #pragma were placed in a source file to refer to the section "MYSEG" before that section was defined.

#pragma alloc_text (MYSEG, MyLocal)

To fix this, define the section before referring to it. For the above example, you could precede the alloc_text statement with a #pragma code_seg statement to define MYSEG.

#pragma code_seg("MYSEG")
   .
   .
   .
#pragma alloc_text (MYSEG, MyLocal)