| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
5.1 Linking Programs With Guile
This section covers the mechanics of linking your program with Guile on a typical POSIX system.
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.
<libguile.h> is not in the default search path for headers,
because Guile supports parallel installation of multiple versions of
Guile, with each version’s headers under their own directories. This is
to allow development against, say, both Guile 2.0 and 2.2.
To compile code that includes <libguile.h>, or links to
libguile, you need to select the effective version you are
interested in, and then ask pkg-config for the compilation flags
or linking instructions. For effective version
2.0, for example, you would invoke
pkg-config --cflags --libs guile-2.0 to get
the compilation and linking flags necessary to link to version
2.0 of Guile. You would typically run
pkg-config during the configuration phase of your program and
use the obtained information in the Makefile.
See the pkg-config man page, for more information.
| 5.1.1 Guile Initialization Functions | What to call first. | |
| 5.1.2 A Sample Guile Main Program | Sources and makefiles. |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
