I’ve installed the CL-PNG package using quicklisp.
(ql:quicklisp 'png)
Now I want to define my own package which depends on the CL-PNG package. Like so:
(defpackage :FOO
(:use :CL :PNG)
(:export :BAR))
When compiling it I get this error:
The name "PNG" does not designate any package.
[Condition of type SB-KERNEL:SIMPLE-PACKAGE-ERROR]
It seems that I have to call (require :PNG) on the REPL before compiling my package.
What do I have to do to make the CL-PNG package available for the compiler without manually call require on the REPL?
UPDATE: I’m using SBCL.
You confuse two separate notions: a
systemand apackage. Apackageis defined by Common Lisp standard and it’s a collection of symbols, a way to control their visibility and usage. Asystemis not defined by the standard, it’s a notion introduced byASDF, which is a collection of metadata to manage files inter-dependencies in a single project in order to be able to properly compile and load it.Quicklispis built on top ofASDFto provide a way to distribute projects, described in the form ofASDF systems.So when you install (
quickload) asystem, calledPNG, this doesn’t mean, that this system has a package, calledPNG. Does the system define any packages (usually it defines one, or even several of them) and how they are called is at the discretion of its author. Most of the projects will havepackage.lisporpackages.lispfiles, where theirpackages are defined.But in the case of
CL-PNGsystem you’re loading, it actually defines the packagePNG, and it should be available in the running process after youquickloadit. But you should somehow load it every time you start your Lisp system.ASDFprovides a means to define a dependency onCL-PNGsystem, so that you can just load only your ownsystem, and all of thesystems it depends on will be loaded automatically, making available allpackages you want to use.