emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Roger Mason <rmason@mun.ca>
To: emacs-orgmode@gnu.org
Subject: Re: Compiling a C++ source block
Date: Tue, 27 Sep 2022 05:56:14 -0230	[thread overview]
Message-ID: <y65czbhp65q.fsf@mun.ca> (raw)
In-Reply-To: <756c0374-abef-8e73-e765-9cfeb03bb462@free.fr>

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


  reply	other threads:[~2022-09-27  9:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26 19:13 Compiling a C++ source block Roger Mason
2022-09-26 19:56 ` tbanelwebmin
2022-09-27  8:26   ` Roger Mason [this message]
2022-09-29  2:25   ` Ihor Radchenko
2022-09-29 20:03     ` tbanelwebmin
2022-11-25  7:45       ` Ihor Radchenko

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.orgmode.org/

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

  git send-email \
    --in-reply-to=y65czbhp65q.fsf@mun.ca \
    --to=rmason@mun.ca \
    --cc=emacs-orgmode@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).