I too always use binder source and EXPORT(*SRCFILE), however for C++ that isn't possible when Class objects need to be exported. The only human codeable way to do that is, unfortunately EXPORT(*ALL) to get the C++ Classes exported correctly.
I have written a routine to generate the binder source for *MODULE once created, and then purge out some of the exports but its a never-ending task.
Sure with IBM i allowed a binder entry of a Class name that would export all of its stuff so we wouldn't need to code EXPORT(*ALL). But IBM told me to go pound sand on this one. :(
------------------------------
Robert Cozzi
------------------------------
Original Message:
Sent: Fri March 01, 2024 09:43 AM
From: Brian Nordland
Subject: C++ Exports from User-Write *SRVPGM
While I can't be entirely sure without an example, one thing that comes to mind as a possible cause is to take a look at how your service program is being created. For example, are you using EXPORT(*SRCFILE) and specifying exactly what exports you want your service program to export, or are you using EXPORT(*ALL)?
In general, I always recommend specifying the exports because it allows you to only export the functions you really want to export, and it gives you added benefits if you set it up correctly (in how you specify the signature) that you can even likely change your service program (for example to add more functionality), without needing to recompile programs that bind to it.
------------------------------
Thanks,
Brian Nordland
Associate Director of Development at Fortra
------------------------------