According to Orlando Llanes:
How can I code an external assembly routine as an object method?
If your object reads
MyObj = object Procedure MyMethod; virtual; (* or not virtual - that's not the question ;*) end (* MyObj *);
then your external assembly routine must be named
Myobj_Mymethod
with one capital letter at the beginning of the object's and the method's name, each. Parameter and return value conventions are the same as with GNU C.
And is it possible to declare a C++ object and import it into Pascal or vice-versa without having to re-write the code?
That's possible, but not recommended. All OOP info gets lost on the transport between both languages; you have to import a Pascal method from C++ using names like described above, manually invoke virtual methods through the VMT, etc. In the other direction, you have to declare C++ methods through cryptic `AsmName' declarations ... it's a pain. Better write some non-OOP wrapper functions.
If someone understands the GNU C++ OOP backend, we could perhaps change this. Perhaps. It might also be that, due to the way multiple inheritance is implemented in C++, GPC's code is more efficient and should therefore better stay like it is.
Peter