home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!sunic!dkuug!diku!klpe
- From: klpe@diku.dk (Klaus Petersen)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: gcc2.2.2 open a library
- Message-ID: <1992Nov18.132139.7556@odin.diku.dk>
- Date: 18 Nov 92 13:21:39 GMT
- References: <1992Nov18.020038.21890@samba.oit.unc.edu>
- Sender: klpe@ask.diku.dk
- Organization: Department of Computer Science, U of Copenhagen
- Lines: 35
-
- Walt.Namitz@launchpad.unc.edu (Walt Namitz) writes:
-
- >Recently I tried out this code fragment which came from the Amiga ROM
- >Kernel Reference Manual.
-
- >#include<stdio.h>
- >#include<intuition/intuition.h>
- >extern long OpenLibrary;
- >struct IntuitionBase *IntuitionBase = NULL;
- >main()
- >{
- > IntuitionBase = (struct IntitionBase *)
- > OpenLibrary("intuition.library",33);
- > if(IntuitionBase == NULL) exit();
- >}
- >When I compile this fragment I get the following error which refers to the
- >line that tries to open the library;
- > Called object is not a function
- >Anyone know what is wrong with this code fragment?
- >Thanx in advance.
-
- >--
- > The opinions expressed are not necessarily those of the University of
- > North Carolina at Chapel Hill, the Campus Office for Information
- > Technology, or the Experimental Bulletin Board Service.
- > internet: laUNChpad.unc.edu or 152.2.22.80
-
-
- When you decalre the function.. OpenLibrary to8be long you need
- to declare it as
- extern long OpenLibrary(); see the difference..
-
- Now gcc nws it is a function not something else..
-
- Klaus Petersen klpe@ask.diku.dk
-