From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: C++ code block not linked [SOLVED] Date: Tue, 28 Nov 2017 18:27:53 +0100 Message-ID: <5A1D9C99.80606@free.fr> References: <5A198E84.5070305@free.fr> <5A1BBFBC.2080203@free.fr> Mime-Version: 1.0 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eJjfr-0006DP-Ah for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 12:28:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eJjfq-0006bl-6K for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 12:27:59 -0500 Received: from smtp3-g21.free.fr ([2a01:e0c:1:1599::12]:41552) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eJjfp-0006YY-TC for emacs-orgmode@gnu.org; Tue, 28 Nov 2017 12:27:58 -0500 Received: from [IPv6:2a01:e35:2e21:def0:8085:c08d:80e7:c415] (unknown [IPv6:2a01:e35:2e21:def0:8085:c08d:80e7:c415]) by smtp3-g21.free.fr (Postfix) with ESMTP id CC99B13F87F for ; Tue, 28 Nov 2017 18:27:53 +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 28/11/2017 18:08, Roger Mason wrote= :
Hello,

Roger Mason <rmason@MUN.CA> writes:

It compiles fine:

c++ -std=3Dc++11 -I/usr/local/include -L/usr/local/lib -lginac
C-src-1053hn1.cpp
Solved by setting:

(setq org-babel-C++-compiler "c++")

I don't recall having had to do this before.

Phew! Very glad to have this working again.  I'm not aware of any other t=
ool
that is as good as org-mode for literate programming and reproducible
research.  A big thank you to those who created and maintain it.

Cheers,
Roger


Good to know it is solved.
You can customize this variable:
=A0 C-h v org-babel-C++-compiler

In case someone else bump into a similar problem, the actual command launched by Babel can be obtained through the debugger:
=A0 M-x debug-on-entry RET org-babel-eval RET
=A0=A0 evaluate the Babel block
The debugger shows a line like this one:
=A0 * org-babel-eval("g++ -o /tmp/babel-3110Zeg/C-bin-3110Fwh -std=3Dc++11 ...
This works for many languages supported by Babel.