home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / amiga / programm / 16021 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.5 KB  |  47 lines

  1. Path: sparky!uunet!mcsun!sunic!dkuug!diku!klpe
  2. From: klpe@diku.dk (Klaus Petersen)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: gcc2.2.2 open a library
  5. Message-ID: <1992Nov18.132139.7556@odin.diku.dk>
  6. Date: 18 Nov 92 13:21:39 GMT
  7. References: <1992Nov18.020038.21890@samba.oit.unc.edu>
  8. Sender: klpe@ask.diku.dk
  9. Organization: Department of Computer Science, U of Copenhagen
  10. Lines: 35
  11.  
  12. Walt.Namitz@launchpad.unc.edu (Walt Namitz) writes:
  13.  
  14. >Recently I tried out this code fragment which came from the Amiga ROM
  15. >Kernel Reference Manual.
  16.  
  17. >#include<stdio.h>
  18. >#include<intuition/intuition.h>
  19. >extern long OpenLibrary;
  20. >struct IntuitionBase *IntuitionBase = NULL;
  21. >main()
  22. >{
  23. >    IntuitionBase = (struct IntitionBase *)
  24. >            OpenLibrary("intuition.library",33);
  25. >    if(IntuitionBase == NULL) exit();
  26. >}
  27. >When I compile this fragment I get the following error which refers to the
  28. >line that tries to open the library;
  29. >    Called object is not a function
  30. >Anyone know what is wrong with this code fragment?
  31. >Thanx in advance.
  32.  
  33. >--
  34. >   The opinions expressed are not necessarily those of the University of
  35. >     North Carolina at Chapel Hill, the Campus Office for Information
  36. >        Technology, or the Experimental Bulletin Board Service.
  37. >           internet:  laUNChpad.unc.edu or 152.2.22.80
  38.  
  39.  
  40. When you decalre the function.. OpenLibrary to8be long you need
  41. to declare it as  
  42.    extern long OpenLibrary();   see the difference..
  43.  
  44. Now gcc nws it is a function not something else..
  45.  
  46. Klaus Petersen   klpe@ask.diku.dk
  47.