unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Basile Starynkevitch <basile@starynkevitch.net>
To: guile-user@gnu.org
Cc: STARYNKEVITCH Basile <basile.starynkevitch@cea.fr>
Subject: How to initialize GNU guile in a C++ command line tool?
Date: Thu, 9 Feb 2023 11:43:15 +0100	[thread overview]
Message-ID: <3ba5480a-d302-0fec-ff40-09f69db3eb75@starynkevitch.net> (raw)

Hello,


My platform is Linux Debian sid x86-64 or Linux Ubuntu 22.10 x86-64. 
Using package guile-3.0-dev (version 3.0.8-2).


I want to drive the Frama-C <https://frama-c.com/> static analyzer with 
a C++ driving program which uses (optionally) Guile to run Frama-C.

My current code (GPLv3+) in on github. Inside the small 
https://github.com/bstarynk/misc-basile/ repository (a small thing, 
containing various unrelated programs and scripts).

For the commit 
https://github.com/bstarynk/misc-basile/commit/6c478ca7cd2d43bc203d0f2b0881a0cdeabaf633 
when I uncomment the lines 501 and 805 there is a link failure.

My guile_has_been_initialized is my global boolean flag.


I coded:


     if (!guile_has_been_initialized)
         {
             guile_has_been_initialized=true;
#warning BUG here related to guile
             //scm_init_eval();


and the build is failing

+ /usr/bin/g++ -O -g -I/usr/include/guile/3.0 -pthread -rdynamic 
clever-framac.cc '-DGIT_ID="6c478ca7cd2d"' -ldl -lguile-3.0 -lgc 
-lpthread -ldl -o clever-framac
clever-framac.cc:500:2: warning: #warning BUG here related to guile [-Wcpp]
   500 | #warning BUG here related to guile
       |  ^~~~~~~
clever-framac.cc:503:2: warning: #warning do_evaluate_guile 
unimplemented [-Wcpp]
   503 | #warning do_evaluate_guile unimplemented
       |  ^~~~~~~
clever-framac.cc:720:2: warning: #warning unimplemented inner_guile [-Wcpp]
   720 | #warning unimplemented inner_guile
       |  ^~~~~~~
clever-framac.cc:726:2: warning: #warning unimplemented do_use_guile [-Wcpp]
   726 | #warning unimplemented do_use_guile
       |  ^~~~~~~
clever-framac.cc:804:2: warning: #warning BUG here related to guile [-Wcpp]
   804 | #warning BUG here related to guile
       |  ^~~~~~~
clever-framac.cc:807:2: warning: #warning unimplemented use Guile here 
[-Wcpp]
   807 | #warning unimplemented use Guile here
       |  ^~~~~~~
/usr/bin/ld: /tmp/cc51HoPM.o: in function `do_evaluate_guile(char const*)':
/home/basile/misc-basile/clever-framac.cc:501: undefined reference to 
`scm_init_eval'
collect2: error: ld returned 1 exit status


Where is my mistake? Notice that -lguile-3.0 is linked!



Thanks for your help.



NB. I might borrow some code from GUILE into http://refpersys.org/


-- 
Basile Starynkevitch<basile@starynkevitch.net>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/


             reply	other threads:[~2023-02-09 10:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 10:43 Basile Starynkevitch [this message]
2023-02-09 11:18 ` How to initialize GNU guile in a C++ command line tool? Maxime Devos

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3ba5480a-d302-0fec-ff40-09f69db3eb75@starynkevitch.net \
    --to=basile@starynkevitch.net \
    --cc=basile.starynkevitch@cea.fr \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).