View previous topic :: View next topic
|
Author |
Message |
R.Kaeferboeck
New User
Joined: 27 Jan 2017 Posts: 5 Location: Austria
|
|
|
|
Hi,
let's suppose I have this fetchable:
Code: |
MYFETCH: PROC(PAR1, PAR2, PAR3)
OPTIONS(FETCHABLE);
DCL (PAR1, PAR2) BIN FIXED(31) PARM;
DCL (PAR3) PTR PARM;
RETURN;
ENTRY1: ENTRY(PAR1, PAR2) RETURNS(BIN FIXED);
RETURN(0);
ENTRY2: ENTRY(PAR3) RETURNS(BIT(1));
RETURN('1'B);
ENTRY3: ENTRY();
RETURN;
END MYFETCH;
|
and I want to call that fetchable from my main-program like that:
Code: |
TEST: PROC OPTIONS(MAIN);
IF '0'B THEN FETCH MYFETCH;
DCL ENTRY1 EXT ENTRY(BIN FIXED(31), BIN FIXED(31)) RETURNS(BIN FIXED);
DCL ENTRY2 EXT ENTRY(PTR) RETURNS(BIT(1));
DCL ENTRY3 EXT ENTRY();
DCL BF BIN FIXED(31);
DCL BV BIT(1);
BF = ENTRY1(0,0);
BV = ENTRY2(NULL());
END TEST;
|
Compile is ok, but linking fails. How can I solve the problem? Is something wrong with the declares of the ext entries? Is it possible at all?
Regards,
Reinhard |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Welcome!
Whatever it is, I guess it is essential to post the failed messages, so as to get specific answers. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
I guess it is essential to post the failed messages, so as to get specific answers.
|
the linkage fails because of the unresolved external references
to entry1,entry2,entry3
nobody told the compiler that entry1,entry2,entry3 are / belong to a fetchable module |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Now i am no PL/I expert, and the true PL/I experts should correct this if it is wrong, but ...- When the MYFETCH module is linked, ENTRY1, ENTRY2 and ENTRY3 should be designated as an ALIAS of MYFETCH, AND
- In the TEST procedure, ENTRY1, ENTRY2 and ENTRY3 should be declared as fetchable and should be fetched.
You got the unresolved reference for ENTRY1, ENTRY2, and ENTRY3 because they were not defined as fetchable, so they were left to be static linked in the TEST procedure. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
I wanted to suggest the same,
but I refrained since I was not able to test
system down for planned maintenance |
|
Back to top |
|
|
R.Kaeferboeck
New User
Joined: 27 Jan 2017 Posts: 5 Location: Austria
|
|
|
|
Thanks for your suggestions, will try it out on Monday and tell you the result.
regards,
Reinhard |
|
Back to top |
|
|
|