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 C2128

'function' : alloc_text/same_seg applicable only to functions with C linkage

pragma alloc_text can only be used with functions declared to have C linkage. The following sample generates C2128:

void func();

/* use this function declaration to resolve the error
extern "C" {
void func();
}
*/

#pragma alloc_text("my segment", func)   // C2128

void main() {
}

void func() {
}