Page 1 of 1

Open rexxsyslib.library

Posted: Sat Sep 17, 2011 8:19 pm
by JosDuchIt
The following and similar code opens the given library (with or without the _NOBLOBALIFACE_

Code: Select all

//#define _NOGLOBALIFACE_
#define __USE_INLINE__
#define MINVERSION  52 

#include <stdio.h>
#include <proto/asl.h>
#include <proto/exec.h>
#include <exec/types.h>
#include <exec/exec.h>
#include <exec/execbase.h>
#include <interfaces/exec.h>
struct Library *AslBase;
struct AslIFace *IAsl; 

int main ()
{

AslBase = OpenLibrary ("asl.library",MINVERSION);  
if (AslBase)
	IAsl = (APTR)GetInterface(AslBase, "main", 1L, NULL); 
else printf("no AslBase\n");

printf("hello\n");
if (AslBase)	 	CloseLibrary (AslBase); //changed 
	if (IAsl)		DropInterface( (struct Interface *) IAsl);

}
the code following does not open the rexxsyslib.library (with or without the _NOGLOBALIFACE_
the Base and IFace defintione are taken from <proto/rexxsyslib.h>

Code: Select all

/#define _NOGLOBALIFACE_
#define __USE_INLINE__
#define MINVERSION  52 

#include <stdio.h>
#include <proto/rexxsyslib.h>
#include <proto/exec.h>
#include <exec/types.h>
#include <exec/exec.h>
#include <exec/execbase.h>
#include <interfaces/exec.h>
struct Library *RexxSysBase;
struct RexxSysIFace *IRexxSys;

int main ()
{

RexxSysBase = OpenLibrary ("rexxsyslib.library",MINVERSION);  //changed 
if (RexxSysBase)
	IRexxSys = (APTR)GetInterface(RexxSysBase, "main", 1L, NULL); //changed 
else printf("no RexxSysBase\n");

printf("hello\n");

if (RexxSysBase)	 	CloseLibrary (RexxSysBase); //changed 
	if (IRexxSys)		DropInterface( (struct Interface *) IRexxSys);

}
What is happening here?

Re: Open rexxsyslib.library

Posted: Sun Sep 18, 2011 10:45 am
by chris
rexxsyslib.library is still 68k, make sure you have rexxsyslib.l.main in libs:

Re: Open rexxsyslib.library

Posted: Sun Sep 18, 2011 11:48 am
by JosDuchIt
make sure you have rexxsyslib.l.main in libs:

i do have it.


Does the code works for you ?

Re: Open rexxsyslib.library

Posted: Sun Sep 18, 2011 6:21 pm
by chris
JosDuchIt wrote:
make sure you have rexxsyslib.l.main in libs:

i do have it.


Does the code works for you ?
It does after I change line 3 to:
#define MINVERSION 45

Re: Open rexxsyslib.library

Posted: Sun Sep 18, 2011 10:12 pm
by JosDuchIt
Thanks a lot.
Meanwhile, hitting my head on the table