Hi. Sorry for maybe bringing up an old topic, but it seemed like the proper place to me. Pleas, feel free to move this post if you feel like.
I'm trying to figure out how to get several files compiled. I've followed several tutorials, but none worked (let alone following some illusionary good practices and avoiding deprecated API

.
So, here I am, the code should explain my struggle, but if it doesn't, the explanation follows:
Code: Select all
(defpackage video-rounds-system
(:use :common-lisp :asdf))
(in-package :video-rounds-system)
(defsystem "video-rounds"
:description "rounds-web: a testing environment for Rounds project."
:version "0.0.1"
:author "wvxvw"
:components ((:file "./rounds-web/packages.lisp") ;; defines (defpackage :rounds-web)
(:file "./rounds-web/server.lisp" :depends-on ("./rounds-web/packages.lisp"))
(:file "./rounds-web/serialization.lisp" :depends-on ("./rounds-web/packages.lisp"))
(:file "./rounds-web/error-handlers.lisp" :depends-on ("./rounds-web/packages.lisp"))
(:file "./rounds-web/success-handlers.lisp" :depends-on ("./rounds-web/packages.lisp"))
(:file "./rounds-web/services.lisp" :depends-on ("./rounds-web/packages.lisp"))
(:file "./rounds-web/snapshot.lisp" :depends-on ("./rounds-web/packages.lisp"))))
(asdf:oos :video-rounds)
(require :rounds-web)
(rounds-web:start-server)
The error:
Code: Select all
* (compile-file "start-server.lisp" :output-file "start-server")
; compiling file "/home/wvxvw/Projects/rounds/rounds-net/test-web-server/start-server.lisp" (written 02 MAY 2011 01:11:18 PM):
; compiling (DEFPACKAGE VIDEO-ROUNDS-SYSTEM ...)
; compiling (IN-PACKAGE :VIDEO-ROUNDS-SYSTEM)
; compiling (DEFSYSTEM "video-rounds" ...)
; compiling (OOS :VIDEO-ROUNDS)
; compiling (REQUIRE :ROUNDS-WEB);
; compilation unit aborted
; caught 1 fatal ERROR condition
; compilation aborted because of fatal error:
; READ failure in COMPILE-FILE:
; SB-INT:SIMPLE-READER-PACKAGE-ERROR at 901 (line 18, column 24) on #<SB-SYS:FD-STREAM for "file /home/wvxvw/Projects/rounds/rounds-net/test-web-server/start-server.lisp" {B0D9419}>:
; package "ROUNDS-WEB" not found
; compilation aborted after 0:00:00.007
NIL
T
T
*
Just to make sure I'm sane: this is the ./rounds-web/packages.lisp file
Code: Select all
(require :hunchentoot)
(defpackage :rounds-web
(:use :cl :hunchentoot)
(:export :start-server))
I have the file that defines a "system", which as far as my understanding permits means to tell SBCL to load specified files and compile them. After that I'm trying to require a package defined in those files, and whoops, no package... How do I even know what (defsystem) did? Am I at all understanding right what it was meant to do? I tried (operate-on-sytem) instead of (asdf:oos) with same results.
I've tried different ways of defpackage (the quote form and just a string, which I don't really understand the difference in the given context to no avail).
My Lisp is SBCL. This is probably not the newest version, but I would be thankful if the answer didn't involve updating and using some more libraries. I know I will have to update, but I'm just not able to do it now

. If you may advise any reading on how to compile multiple files in the simplest way (I'm not doing anything complex!) that would help too.
Thanks in advance.
EDIT: For the future reference, I discovered that probably where it says :file, it doesn't really mean file, instead it only wants the file name (please correct me if I'm wrong, I'd really like to be wrong on that!) and the file must be in the same folder as *asd where you defined the system.
I finally got it working. But please tell me if I did it wrong! In this way:
Code: Select all
(in-package :cl-user)
(require :hunchentoot)
(require :cxml)
(require :cl-ppcre)
(require :cl-gd)
(defpackage video-rounds-system
(:use :common-lisp :cl :asdf :hunchentoot :cxml :cl-ppcre :cl-gd))
(in-package :video-rounds-system)
(asdf:defsystem #:video-rounds
:description "rounds-web: a testing environment for Rounds project."
:version "0.0.1"
:author "wvxvw"
:components ((:file "packages") ;; defines (defpackage #:rounds-web)
(:file "server" :depends-on ("packages"))
(:file "serialization" :depends-on ("packages"))
(:file "error-handlers" :depends-on ("packages"))
(:file "success-handlers" :depends-on ("packages"))
(:file "services" :depends-on ("packages"))
(:file "snapshot" :depends-on ("packages"))))
Moved inside the ./rounds-web directory.
Code: Select all
(asdf:oos 'asdf:load-op :video-rounds)
(rounds-web:start-server)
also moved inside ./rounds-web .
I would be very happy to know how would I go about putting files in my project into different directories (there aren't too many of them, but I just like it to be in some order

)