NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2341

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

A #pragma or __declspec(allocate()) statement refers to a segment not yet defined #pragma code_seg or #pragma data_seg.

Example

The following #pragma appears in a source file before "MYSEG" is defined:

#pragma alloc_text (MYSEG, MyLocal) // error

To fix this error, define the segment before referring to it. For this example, use #pragma code_seg to define MYSEG before alloc_text:

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