Re: [Seed7-users] Library search path
Interpreter and compiler for the Seed7 programming language.
Brought to you by:
thomas_mertes
From: Thomas M. <tho...@gm...> - 2011-03-18 13:31:35
|
At Thu, 17 Mar 2011 13:53:36 -0700 (PDT) Milo Mirate <mm...@ym...> wrote: > Where does the Seed7 interpreter look for libraries to load (from the > "include" statement) and how does one set this option? > I'm sorry if this is a somewhat stupid question. This is NOT a stupid question. I just searched the documentation and I found no good explanation concerning the Seed7 library search path. Therefore I added an FAQ about your question. See: http://seed7.sourceforge.net/faq.htm#lib_path The content of the this FAQ follows: Where does the Seed7 interpreter look for include files / libraries? ==================================================================== Include libraries with absolut path (an absolute path starts with a forward slash) are only searched at the specified place. All other include libraries are searched in several directories. This is done according to the Seed7 library search path. The following directories are in the library search path: 1. The directory of the source file. 2. The hardcoded library directory of the interpreter (an absolute path like "/directory_where_Seed7_was_installed/seed7/lib"). The hardcoded library directory is determined when the interpreter is compiled. So it only exists when the interpreter was compiled from source. The interpreter from the binary release uses a different strategy: When the path to the current program ends with "prg" it is replaced with "lib" and added to the library search path. E.g.: When "seed7/prg/hello.sd7" is interpreted the include files are searched in "seed7/lib". 3. The directory specified with the SEED7_LIBRARY environment variable. 4. Directories specified in the source file with the library pragma. E.g. a line like: $ library "/home/tm/seed7/lib" Seed7 compiler (comp.s7i) and interpreter use the same library search path. They will find Seed7 include files automatically, when Seed7 was compiled from source code. The interpreter from the binary release will only find library include files when programs from the "seed7/prg" directory are interpreted. To interpret programs from other directories with the binary interpreter it is necessary to set the environment variable SEED7_LIBRARY to the absolute path "/directory_where_Seed7_was_installed/seed7/lib". ----------------------- [ End of citation ] ----------------------- Hopefully that helps. If you have questions or sugestions, please tell me. Greetings Thomas Mertes -- Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows. -- GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit gratis Handy-Flat! http://portal.gmx.net/de/go/dsl |