Error: illegal foreign type `(c-pointer struct tm)' pasted by ubotxyz201 on Fri Oct 16 08:09:04 2015
;; I am trying to compile this code in Chicken Scheme, however it is not working. Any idea?? ;; ;; csc -c -C -fPIC testffi.scm -lgsl -lgslcblas -lm ;; Error: illegal foreign type `(c-pointer struct tm)' ;; ;; Error: shell command terminated with non-zero exit ;; ;; status 256: ;; '/usr/local/bin/chicken' 'testffi.scm' -;; ;; output-file 'testffi.c' ;; Makefile:15: recipe for target 'testffi' failed ;; make: *** [testffi] Error 1 ;; ;; ;; (import scheme chicken foreign) (use srfi-4 extras ports) (use (only srfi-13 string-index)) ;;(use foreigners) (use lolevel) (use easyffi) (require-extension bind) (require-extension srfi-4) (foreign-declare " #include <math.h> #include <time.h> ") ;;time_t mktime(struct tm *tm); ;; (define _mktime (foreign-lambda long "mktime" (c-pointer struct "tm")))
Solution added by ubotxyz201 on Fri Oct 16 08:59:48 2015
;; Change ;; from: (c-pointer struct "tm") ;; to: (c-pointer (struct "tm")) ;; ;; (define _mktime (foreign-lambda long "mktime" (c-pointer (struct "tm"))))