(in-package cl-user) (use-package 'sb-alien) (define-alien-type nil (struct test (x unsigned-int) (y unsigned-int) (z unsigned-int) (w unsigned-int))) (load-shared-object "/home/vaartis/Code/sbcl/test.so") (defparameter func (extern-alien "func" (function (struct test) (struct test)))) (with-alien ((test-strct (struct test))) (setf (slot test-strct 'x) 10 (slot test-strct 'y) 11 (slot test-strct 'z) 12 (slot test-strct 'w) 13) (let ((res (alien-funcall func test-strct))) (inspect res) (assert (equal (slot res 'x) 11)) (assert (equal (slot res 'y) 13)) (assert (equal (slot res 'z) 15)) (assert (equal (slot res 'w) 17))))