Open rexxsyslib.library

This forum is for general developer support questions.
Post Reply
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Open rexxsyslib.library

Post 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?
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Open rexxsyslib.library

Post by chris »

rexxsyslib.library is still 68k, make sure you have rexxsyslib.l.main in libs:
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: Open rexxsyslib.library

Post by JosDuchIt »

make sure you have rexxsyslib.l.main in libs:

i do have it.


Does the code works for you ?
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Open rexxsyslib.library

Post 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
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: Open rexxsyslib.library

Post by JosDuchIt »

Thanks a lot.
Meanwhile, hitting my head on the table
Post Reply