Hello there!
New in this forum, so hello everyone :).
I have a specific problem which I cannot find solution to…
So I have a my code woven into ABC chain, that is in libsrc, clw/inc, all that jazz. It works fine.
But now I wanted to add a class to manage my BINDs easily.
For that in INC I declared in MAP a bunch of procedure types like a so:
MAP
procs0 procedure(),string,type
procs1 procedure(string p1),string,type
...
procs16 procedure(string....16),string,type
END
Then in the class a series of functions:
mybind procedure(string pName,procs0 pFunc)
mybind procedure(string pName,procs1 pFunc)
...
Source compiles alright, but then linker complains, that [email protected]
… is unresolved for export and same for every function that takes procedure as parameter.
I’d add that overloads on *queue, *group and *? work fine.
Therefore a question - is it possible to have exported procedures that take typed procedure as parameter, are overloaded and in a class? Or is there other solution to this problem maybe? Or maybe I am doing something wrong?
Thanks in advance for any help :).
What is the exact text of the errors? Oftentimes that gives you what your .exp should contain.
The LINKNAME “function” building mangled names in templates does not support procedure-type parameters.
There are 2 ways:
- Use the NAME attribute for functions with procedure-type parameters if these functions are to be exported
- Use the EXPORT attribute for declaration of the CLASS or procedure. The class must be excluded from exporting by templates in this case.
1 Like
Thanks a lot for fast reply.
I’ll try with these advices, but might come back for more :).
Some additional info. There was some discussion regarding support in LINKNAME of procedural types parameters when the new AppGen developed for C7. The problem here is that the mangler must have information that particular named type means: GROUP, QUEUE, CLASS, INTERFACE or procedure. The exact information is not available without strict parsing of involved files. The reader of ABC files gives most data but not all: it can’t handle conditional OMIT/COMPILE blocks dependent from settings in the project, different declarations of data/procs in INC files with SECTIONs, take into account EQUATEs used for identifiers, etc. Therefore the decision was to ignore rare cases in implementation of LINKNAME. Parameters of procedural types were in the list of rares.
Thank you, oh kind soul!, for the “add NAME” advice - it worked perfectly. I would have never found out that solution basing on the documentation alone :/.
So if I understand correctly - LINKNAME is lost in these cases, so I have to provide my own NAME(‘whatever’) for a procedure to have it linked under this name. This removes confusion from the compiler/linker and they now know where to look for?
I did not understand the second solution though. I did not see the ability to put EXPORT on a CLASS in code. I am not very bothered by that since the first solution worked for me. But out of curiosity I would ask for more specifics - if possible :). Maybe an example code or where to look for such a thing?
But anyway thank You very much for Your help :).
The NAME attribute on a procedure disables mangling of its external name.
Read the topic Unknown (?) Feature - EXPORT attribute instead of EXP file
1 Like