Opened 8 years ago

Closed 8 years ago

#1074 closed defect (notabug)

Foreign function not found: WIN64::|gethostname|

Reported by: radack Owned by:
Priority: normal Milestone:
Component: Foreign Function Interface Version: trunk
Keywords: Cc:


When I try to load usocket, an error "Foreign function not found: WIN64::|gethostname|" is displayed.

I am running CCL 64-bit on Windows 7 64-bit.

wx86cl64.exe -I Welcome to Clozure Common Lisp Version 1.9-r15765 (WindowsX8664)! ? (ql:quickload "usocket") To load "usocket":

Load 1 ASDF system:


; Loading "usocket" Read error between positions 220 and 317 in C:/Users/Gerry/quicklisp/dists/quicklisp/software/usocket-

Error: Foreign function not found: WIN64::|gethostname| While executing: CCL::LOAD-EXTERNAL-FUNCTION, in process listener(1). Type :POP to abort, :R for a list of available restarts. Type :? for other options.

1 >

The error seems to be in the following code:

(defun get-host-name ()

(ccl::%stack-block ((resultbuf 256))

(when (zerop (#_gethostname resultbuf 256))

(ccl::%get-cstring resultbuf))))

Change History (4)

comment:1 Changed 8 years ago by rme

Does ccl have access to its interface database? If you start up ccl and evaluate (probe-file "ccl:"), the output directory is what we call the ccl directory.

The ccl directory should contain a directory named win64-headers containing the interface database. If that directory is not there, ccl will not know how to turn #_gethostname into the proper external function call.

This could happen if you've copied the heap image (your file" somewhere out of the distribution directory.

comment:2 Changed 8 years ago by radack

I was running CCL with a heap image outside the distribution directory. I copied the heap image to the distribution directory and ran it from there and it worked.

Is there a way to get it to work with the heap image outside the distribution directory?

comment:3 Changed 8 years ago by rme

You can set the environment CCL_DEFAULT_DIRECTORY to the location of the distribution directory (or whatever directory contains the interface database, sources, etc.).

See section 4.6.2 of the manual:

comment:4 Changed 8 years ago by radack

  • Resolution set to notabug
  • Status changed from new to closed


Note: See TracTickets for help on using tickets.