[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Compiling a C++ source block
From: |
Roger Mason |
Subject: |
Re: Compiling a C++ source block |
Date: |
Tue, 27 Sep 2022 05:56:14 -0230 |
User-agent: |
mu4e 1.6.6; emacs 27.2 |
Hello,
tbanelwebmin <tbanelwebmin@free.fr> writes:
> You may try:
> #+header: :includes '("<iostream>" "<ginac.h>")
>
> Also, you have this commented line:
> # #+header: :var table=
> It seems to break the #+header: chain
> Just remove it.
>
> By the way, to figure out future compilation problems, you may click on the
> error:
> /tmp/babel-eqG2i0/C-src-3zG2ec.cpp:16:1: error: unknown type name 'ex'
> This will open the source file actually being compiled.
>
> Have fun!
Thank you. For the record, this works:
#+name: gnc_cav
#+header: :includes '("<iostream>" "<ginac/ginac.h>")
#+header: :libs -I/usr/local/include -L/usr/local/lib -lginac -lcln
#+header: :flags -std=c++17
#+header: :namespaces std GiNaC
#+header: :var job="vectors" :var vol=113.13115406160385926 :var
r=1.0995524816924328312
#+header: :var a=4.916 :var c=5.4054
#+header: :main no
Note the :libs line specifies an include path. A bit unintuitive, but
it does the job. Specifying a path in the :includes does not work (and
nothing in the docs suggests that it should).
By the way, 'C-c C-v v' also provides access to the file sent for compilation.
Thanks again,
Roger