English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. C/C++ (http://eab.abime.net/forumdisplay.php?f=118)
-   -   ClassAct/Reaction & Eclipse/GCC Cross Chain (http://eab.abime.net/showthread.php?t=103488)

Warty 09 August 2020 23:10

ClassAct/Reaction & Eclipse/GCC Cross Chain
- I haven't programmed BOOPSI, ClassAct, or Reaction previously (No taglist experience). I have worked with the KS 1.3 style "busy work yourself to death" widgets.
- I just got Bebbo's awesome GCC cross chain working this week; previously was using VBCC; have no experience using Lattice C on Amiga.

- Getting ready for AmigaOS 3.2 dev by getting up to speed on BOOPSI > Reaction widgets/layout.

- Do not have 3.2 or 3.9, so don't have an SDK/WB combo that has reaction-style widgets

Workaround #1:
- Found a post here indicating that GCC includes can be tweaked to us CA instead of RA, and then in combination with ClassAct 3 which is on Aminet, can program against it. Made copies where relevant, so I didn't mangle my reaction headers, and that seemed pretty straightforward. Found a few places where it was still CA_ anyway :)


Problem #1: Eclipse doesn't seem to like the macros for list building, which only include a starting (, not the close (which gets supplied later by a different macro). Well, I'm not sure if that's what it is objecting to, but that's what the warning involves.

Example code:

objects[OID_MAIN] = IIntuition->NewObject(WindowClass, NULL,
/* objects[OID_MAIN] = WindowObject, */
WA_ScreenTitle, "ClassAct",
WA_Title, "ClassAct Window Example",
WA_Activate, TRUE,
WA_DepthGadget, TRUE,
WA_DragBar, TRUE,
WA_CloseGadget, TRUE,
WA_SizeGadget, TRUE,
WA_Width, 200,
WA_Height, 150,
WINDOW_IconifyGadget, TRUE,
WINDOW_IconTitle, "Example",
WINDOW_AppPort, AppPort,
WINDOW_ParentGroup, VLayoutObject,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_DeferLayout, TRUE,

Eclipse gives a warning of "Missing ')' in parameter list of macro: NewObject"

On compile, I get an error like this:
../src/classact_test1.c:176:0: error: unterminated argument list invoking macro "NewObject"

I checked the macros, and as far as I can tell, it does seem like they are visible, and getting resolved at the preprocessor step. For example, NewObject is that rather long thing; and EndWindow eventually resolves to 0.

#define NewObjectA(___classPtr, ___classID, ___tagList) \
LP3(0x27c, APTR, NewObjectA , struct IClass *, ___classPtr, a0, CONST_STRPTR, ___classID, a1, const struct TagItem *, ___tagList, a2,\

#define End TAG_END)
#define TAG_END (0L) /* synonym for TAG_DONE */

there's another challenge I need help with, with the hook, but I'll save that for another post.

thomas 10 August 2020 09:32

Remove that IIntuition-> and all other ISomething-> from your source code. This code is for Amiga OS 4. It does not compile for 3.x.

Also narrow down a possible mistake by starting with

myobject = NewObject (class,NULL, TAG_END);

If this compiles, add more tags one by one.

Also don't mix function call style with ReAction macros style. Don't use EndObject, EndGroup and the like if you don't also use WindowObjecrt, LayoutObject and so on.

Function call style is better because you can match brackets to see if you closed all open brackets.

Warty 14 August 2020 06:54

Thanks for the info and advice Thomas.

I struggled quite a bit with it, and at this point, I think there are maybe 2 things going wrong. I got ahold of the 2.1 developer CD, and went for a very basic code example in there. It compiles with GCC, but the exec doesn't run (exits before debugger can hit a break). That same code compiled with VBCC runs fine. So I dunno what to do there.

The 2nd problem I think is around trying to use ReAction code renamed to classAct, without knowing how either really works, and which code in Reaction is newer than classAct, etc. I haven't had any luck getting my setup to work under VBCC once I introduce the classact/reaction stuff. I think I'll just stay away from that for now, until 3.2 is out with a new NDK and updated docs.

There are quite a lot of changes between the 1.3 stuff and the 3.1 stuff I can get familiar with in the meantime, and update some apps to use it. I'll figure out reaction-for-3.2 when it's available.

All my Amiga books are for KS 1.x, I wish I had one that was 3.0 or 3.1 based.

Minuous 15 August 2020 18:41

>That same code compiled with VBCC runs fine. So I dunno what to do there.

You haven't given enough info to really diagnose the issue, so using VBCC would be the obvious solution to recommend. It should also work with SAS/C, StormC etc.

>trying to use ReAction code renamed to classAct, without knowing how either really works, and which code in Reaction is newer than classAct, etc.

You can get the 3.9 NDK, which contains ReActionized includes, so there is no need to rename any ReAction stuff to ClassAct. The minimum versions required for any particular feature are specified in the autodocs.

Are you making sure your compilers are using modern includes rather than the ones they were provided with?

All times are GMT +2. The time now is 05:24.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.04157 seconds with 11 queries