[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] C++ code block not linked
From: |
Roger Mason |
Subject: |
Re: [O] C++ code block not linked |
Date: |
Sun, 26 Nov 2017 08:12:27 -0330 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix) |
Hello,
Thierry Banel <address@hidden> writes:
> On 25/11/2017 15:59, Roger Mason wrote:
>> 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 <iostream>
>> #include <ginac/ginac.h>
>> 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<char,
>> std::char_traits<char>, std::allocator<char> > const&)'
>>
>
> 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
I just upgraded to Org mode version 9.1.3 (release_9.1.3-185-g579fa1 @
/home/rmason/.emacs.d/org-git/lisp/) and I'm still getting the link
error.
Cheers,
Roger
- [O] C++ code block not linked, Roger Mason, 2017/11/25
- Re: [O] C++ code block not linked, Thierry Banel, 2017/11/25
- Re: [O] C++ code block not linked,
Roger Mason <=
- Re: [O] C++ code block not linked, Thierry Banel, 2017/11/27
- Re: [O] C++ code block not linked, Roger Mason, 2017/11/27
- Re: [O] C++ code block not linked [SOLVED], Roger Mason, 2017/11/28
- Re: [O] C++ code block not linked [SOLVED], Thierry Banel, 2017/11/28
- Re: [O] C++ code block not linked [SOLVED], Nick Dokos, 2017/11/28
- Re: [O] C++ code block not linked [SOLVED], Roger Mason, 2017/11/29