home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / prolog / 1669 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  2.3 KB

  1. Path: sparky!uunet!munnari.oz.au!goanna!ok
  2. From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
  3. Newsgroups: comp.lang.prolog
  4. Subject: Re: Time and Date in Quintus P.
  5. Message-ID: <14399@goanna.cs.rmit.oz.au>
  6. Date: 8 Sep 92 04:42:23 GMT
  7. References: <1992Sep3.201023.6191@tom.rz.uni-passau.de> <1992Sep4.185308.12558@tom.rz.uni-passau.de>
  8. Organization: Comp Sci, RMIT, Melbourne, Australia
  9. Lines: 47
  10.  
  11. In article <1992Sep4.185308.12558@tom.rz.uni-passau.de>, baier@forwiss.uni-passau.de (Joern Baier) writes:
  12. : gandalf:~/prolog/dp 104> prolog
  13. : | ?- [library(date)].
  14. : [consulting /private/projects/quintus/generic/qplib2.5.1/library/date.pl...]
  15. :  [consulting /private/projects/quintus/generic/qplib2.5.1/library/errno.pl...]
  16. :  [errno.pl consulted in module errno 0.500 sec 11,884 bytes]
  17. : ld:
  18. : Undefined:
  19. : gmtime
  20. : localtime
  21. : [ERROR: Foreign interface, call to Unix "ld" failed (error 413)]
  22. :  [Loading of foreign files NOT completed]
  23. : [date.pl consulted in module date 1.333 sec 22,508 bytes]
  24. You have a serious problem there, because gmtime() and localtime() are
  25. UNIX library functions.  More than that, they are required by the ANSI
  26. C standard.  The linker should have found them.  You will need to check
  27. that QP has been installed correctly, and especially to verify that ld
  28. is being called with the correct command-line arguments.
  29.  
  30. : ----------------------------------------------------------------------
  31. : gandalf:~/prolog/dp/date 111> gcc date.c
  32.  
  33. You do not want a complete program.  You want a ".o" (object, linkable)
  34. file.  For that, the correct command is
  35.     gcc -c date.c
  36.         ^^
  37. : date.c: In function `QD4mat':
  38. : date.c:358: warning: suggest parentheses around && within ||
  39. Sheesh.  Does it also say "suggest parentheses around * within +"?
  40. Ignore that message.
  41. : ld:
  42. : Undefined:
  43. : main
  44. : QP_atom_from_string
  45. : collect: /usr/bin/ld returned 1 exit status
  46.  
  47. : It seems that 'QP_atom_from_string' is not defined.
  48.  
  49. Yes it is.  It is defined in the Quintus Prolog system itself.
  50. The *.c files in the library area are _not_ meant to be compiled as
  51. separate programs, but as ".o" files which will later be linked with
  52. the Prolog system (either statically, if you so choose when using qpc,
  53. or dynamically, if you use load_foreign_files).  Just add the "-c" option.
  54.  
  55. -- 
  56. You can lie with statistics ... but not to a statistician.
  57.