Compiler Error C2193

'identifier' : already in a segment

A function was placed in two different segments using the alloc_text and code_seg pragmas.

The following is an example of this error:

extern "C" void foo();
#pragma alloc_text(MYCODE, foo)
#pragma code_seg("MYCODE2")
extern "C" void foo()
{               // error
}