The source below is compiled with
gcc guis:Dev/Gui4Cli_Dev/G4C_18/piper.c -gstabs -lauto -N -o g18:piper
and gives no errors or warnings.
The debug print statements observed are indicated with "seen"
I don't understand what could go wrong with the AllocSysObject here (copied from a source where it works oK.
What other tests could i add before these last lines ??
int main(void) { LONG ProgRET=20, c ;///d BOOL rxmsgreplied=0; ///, wnmsgreplied, flag=0; char *buff=NULL;/// *gcdata=NULL; int stop=0; ///, comret, INTUIisopen=0; struct RexxMsg *rxmsg = NULL; struct g4cmsg *gcmess= NULL; struct Remember *rkey=NULL; struct LaunchMessage *lmess; ///used also with xPIPE handling char *pt; ///*gp=NULL, *pt; ///struct GCmain *gd=NULL; strcpy (myportname, "Gui4Cli"); // * name of default port * / RexxSysBase = OpenLibrary ("rexxsyslib.library",45); //changed if (RexxSysBase) IRexxSys = (APTR)GetInterface(RexxSysBase, "main", 1L, NULL); //changed else PutStr("no RexxSysBase"); // not seen if (!(gd = (struct GCmain *)AllocRemember (&rkey, sizeof(struct GCmain), MEMF_CLEAR))) /// IIntuition-> { PutStr("no GCmain obtained\n"); //not seen goto endprog; } initgd (); // ------------------------ get main buffers ----------------------- if (!(getbuffers(gd->buffsize, 0))) { PutStr("no buff obtained\n"); /// IDOS-> //not seen goto endprog; } buff = gd->membuff[0]; // *------------------- Get default console ---------------------* / // *------------------------- PASS to other Gui4Cli if running -----------* / // *---------------------- Open Message ports ----------------------* / // *------------------------ Open other libs etc.. -----------------------* / if ( ! IntuitionBase || !UtilityBase ) goto endprog; if ( ! IIntuition || !IUtility ) goto endprog; if ( ! DOSBase ) goto endprog; if ( ! IDOS ) goto endprog; if ( ! RexxSysBase ) goto endprog; if ( ! IRexxSys ) goto endprog; Dp(PutStr("Main 7\n")); //seen Dp(Printf ("Findport %s \n", myportname)); /// Findport Gui4Cli seen Forbid (); //IExec-> taskscheduler if (FindPort(myportname)==NULL) { Dp(Printf ("Findport %s \n", myportname)); /// Findport Gui4Cli Seen myrxport=AllocSysObjectTags(ASOT_PORT, ASOPORT_Name, myportname, TAG_END); /// IExec-> } Permit(); /// IExec-> if (!myrxport) { Printf ("%s could not create myPorts\n", myportname); /// SEEN ??? ProgRET = 20; goto endprog; }