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 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);
}