From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: C++ code block not linked Date: Sat, 25 Nov 2017 16:38:44 +0100 Message-ID: <5A198E84.5070305@free.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIcXY-0005cK-Nt for emacs-orgmode@gnu.org; Sat, 25 Nov 2017 10:38:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIcXX-0006hX-TO for emacs-orgmode@gnu.org; Sat, 25 Nov 2017 10:38:48 -0500 Received: from smtp6-g21.free.fr ([2a01:e0c:1:1599::15]:48820) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eIcXX-0006gG-Ln for emacs-orgmode@gnu.org; Sat, 25 Nov 2017 10:38:47 -0500 Received: from [IPv6:2a01:e35:2e21:def0:6018:d70d:693f:adec] (unknown [IPv6:2a01:e35:2e21:def0:6018:d70d:693f:adec]) by smtp6-g21.free.fr (Postfix) with ESMTP id 4D97978031A for ; Sat, 25 Nov 2017 16:38:44 +0100 (CET) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org On 25/11/2017 15:59, Roger Mason wrote: > Hello, > > This code compiles fine on command line but org-babel can't link it. > > #+BEGIN_SRC C++ :flags "-std=c++11 -I/usr/local/include" :libs "-L/usr/local/lib -lginac" > #include > #include > using namespace std; > using namespace GiNaC; > > int main () { > symbol a("a"), b("b"), x("x"), y("y"); > lst eqns, vars; > eqns = a*x+b*y==3, x-y==b; > vars = x, y; > cout << lsolve(eqns, vars) << endl; > // -> {x==(3+b^2)/(b+a),y==(3-b*a)/(b+a) > > return 0; > } > #+END_SRC > > The error buffer contains many lines like this: > > /tmp//ccv5YYn1.o: In function `main': > C-src-1046xti.cpp:(.text+0x67): undefined reference to `GiNaC::symbol::symbol(std::__cxx11::basic_string, std::allocator > const&)' > > > Org mode version 9.0.3 (release_9.0.3-170-gfed1cf @ > /home/rmason/.emacs.d/org-git/org-mode/lisp/) > > GNU Emacs 25.3.1 (i386-portbld-freebsd10.3, GTK+ Version 3.22.15) of > 2017-11-22 > > Thanks for any help. > > Roger > > I get the correct result: #+RESULTS: | {x==(3+b^2)*(a+b)^(-1) | y==-(-3+a*b)*(a+b)^(-1)} | I use Or mode version 9.1.1