Node:Linking Programs With Guile, Next:, Previous:Guile Scripts, Up:Whirlwind Tour

5.3 Linking Programs With Guile

The Guile interpreter is available as an object library, to be linked into applications using Scheme as a configuration or extension language. This chapter covers the mechanics of linking your program with Guile on a typical POSIX system.

Parts III and IV of this manual describe the C functions Guile provides. Furthermore, any Scheme function described in this manual as a "Primitive" is also callable from C; see Primitives.

The header file <libguile.h> provides declarations for all of Guile's functions and constants. You should #include it at the head of any C source file that uses identifiers described in this manual. Once you've compiled your source files, you need to link them against the Guile object code library, libguile.

On most systems, you should not need to tell the compiler and linker explicitly where they can find libguile.h and libguile. When Guile has been installed in a peculiar way, or when you are on a peculiar system, things might not be so easy and you might need to pass additional -I or -L options to the compiler. Guile provides the utility program guile-config to help you find the right values for these options. You would typically run guile-config during the configuration phase of your program and use the obtained information in the Makefile.