Author
Topic: list of inherited objects (Read 346 times)

Trying to compile an old AmigaE project, I have fixed lots of FLOAT issues, and annoying `ENDPROC SUPER self.end()` issues complaining about bad number of return values (similarly Throw() has 0 return values when it should have any type at all), and finally got stuck with this big problem:

NEW [ NIL, NIL, 'name', CALLBACK func() ] : classnodeis being used to create a new object.

Because you are using the "OPTAMIGAE" switch, I think (I may be wrong) it's automatically making all objects be CLASSes (i.e. inherit from the "class" object).This unfortunately means you run into a PortablE limitation, where it doesn't allow arrays/lists of class objects. In reality you are only creating a single new class object, so you shouldn't really get this error, but I don't have time to fix PortablE at the moment, so the best I can suggest is some work-arounds.

The simplest work-around is (probably) to get rid of that OPTAMIGAE switch, and instead add OPT AMIGAE at the top of each module *except* for the "list.e" module (which defines the parent "node" object). With luck that will solve your problem (you will also need to tweak the "list.e" module to use PortablE syntax, e.g. get rid of EXPORT).

But if that doesn't solve your problem, then you might need to do small rewriting of your code. Looking at the definition of "classnode" I see:

OBJECT nodenext : PTR TO nodeprev : PTR TO nodename : PTR TO CHARENDOBJECTSo what I suggest is that you change how new objects (like "classnode") are created. Let's have a procedure call do the job instead. In the "classnode.e" module add this:

So what I suggest is that you change how new objects (like "classnode") are created. Let's have a procedure call do the job instead.

Thanks! With that change and a couple of other small fixes PortablE.exe in WINE now successfully compiles my project to a C++ source file for AROS. Next step is setting up a C++ cross-compiler from Linux to AROS.