[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Can not work with libguile-2.0
From: |
Mark Harig |
Subject: |
Re: Can not work with libguile-2.0 |
Date: |
Thu, 17 Feb 2011 14:08:00 -0500 |
I run the mannal cmd and also have something wrong:
---->cut here<----
$ gcc -shared -o libguile-bessel.so -fPIC t1.c
t1.c:2:22: error: libguile.h: No such file or directory
t1.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before
‘j0_wrapper’
t1.c: In function ‘init_bessel’:
t1.c:13: error: ‘j0_wrapper’ undeclared (first use in this function)
t1.c:13: error: (Each undeclared identifier is reported only once
t1.c:13: error: for each function it appears in.)
---->cut here<----
But when I run cmd:
gcc -shared -o libguile-bessel.so -fPIC t1.c `pkg-config --cflags
--libs
guile-2.0`
everything is OK!
Agreed. The command listed in section 2.4 "Writing Guile Extensions"
should follow the pattern used in section 2.3 "Linking Guile into
Programs," namely, add the 'pkg-config' command to provide the
appropriate command-line options for the preprocessor, compiler, and
linker. In addition, the manual should mention that the environment
variable 'PKG_CONFIG_PATH' needs to be set before invoking the
compiler. Something like the following needs to be added, along with
some explanatory text:
$ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
$ gcc -shared -o libguile-bessel.so -fPIC t1.c `pkg-config --cflags
--libs guile-2.0`
The manual should provide this extra detail so that new users can
simply follow the steps listed without having to refer to external
documents.
--