Bingo! Thanks. I almost wrote to you directly rather than asking the list ...
Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of David Crayford Sent: Monday, November 17, 2014 5:38 PM To: [email protected] Subject: Re: How declare in C++ a constant in an assembler module? The compiler wants to put all external variables into WSA. To turn that off specify norent. #pragma variable(FOO,norent) extern const long FOO; On 18/11/2014 9:31 AM, Charles Mills wrote: > I have a C++ program. I have three "global" constants that I wish to > define in assembler modules. Environment: prelinker, non-XPLINK, RENT. > > Here is what I am doing now: > > In the C++ at namespace scope: > > extern const long FOO; > > In the Assembler: > > FOO DC F'123' > ENTRY FOO > > The error I am getting from the prelinker is ERROR EDC4014: Undefined > writable static objects are detected: FOO > > I suspect this is due to the fact that the C++ compiler and link > magically make static variables reentrant: if you say static int bar > there is actually one copy of bar for each executing instance of your program. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
