From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Basile Starynkevitch Newsgroups: gmane.lisp.guile.user Subject: How to initialize GNU guile in a C++ command line tool? Date: Thu, 9 Feb 2023 11:43:15 +0100 Message-ID: <3ba5480a-d302-0fec-ff40-09f69db3eb75@starynkevitch.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28030"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: STARYNKEVITCH Basile To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Feb 09 11:43:56 2023 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pQ4PE-00074S-JI for guile-user@m.gmane-mx.org; Thu, 09 Feb 2023 11:43:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQ4Ol-0005zP-RZ; Thu, 09 Feb 2023 05:43:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQ4Oj-0005z2-KT for guile-user@gnu.org; Thu, 09 Feb 2023 05:43:25 -0500 Original-Received: from relay11.mail.gandi.net ([217.70.178.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQ4Oh-0002Wk-4E for guile-user@gnu.org; Thu, 09 Feb 2023 05:43:25 -0500 Original-Received: (Authenticated sender: basile@starynkevitch.net) by mail.gandi.net (Postfix) with ESMTPSA id 3938410000A; Thu, 9 Feb 2023 10:43:16 +0000 (UTC) Content-Language: en-US Received-SPF: pass client-ip=217.70.178.231; envelope-from=basile@starynkevitch.net; helo=relay11.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:18896 Archived-At: 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 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 (only mine opinions / les opinions sont miennes uniquement) 92340 Bourg-la-Reine, France web page: starynkevitch.net/Basile/