From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hannon Subject: Details of compling and running C++ code from Org-mode? Date: Sat, 5 Nov 2011 00:44:24 -0700 (PDT) Message-ID: <1320479064.94834.YahooMailNeo@web161908.mail.bf1.yahoo.com> Reply-To: Michael Hannon Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:50836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMavS-0008Py-So for emacs-orgmode@gnu.org; Sat, 05 Nov 2011 03:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMavR-0004tw-RH for emacs-orgmode@gnu.org; Sat, 05 Nov 2011 03:44:26 -0400 Received: from nm17.bullet.mail.bf1.yahoo.com ([98.139.212.176]:47822) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RMavR-0004ts-M3 for emacs-orgmode@gnu.org; Sat, 05 Nov 2011 03:44:25 -0400 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-Mode List =0A=0AGreetings.=A0 I'm curious about the process of executing a program th= at is=0Acompiled from a source block in Org-mode.=0A=0ASome background: I w= as playing with some C++ code (a slight generalization of=0Asome code I fou= nd in a book).=A0 I wanted to use the "assign" method to=0Ainitialize a vec= tor, as:=0A=0A=A0=A0=A0 vector testVec(5, 0);=0A=A0=A0=A0 testVec.assi= gn({2, 4, 6, 8, 10});=0A=0AIt turns out that to do this one has to tell g++= (in my case) to use the=0Alatest version of the C++ standard.=A0 I discove= red that I could do this via:=0A=0A=A0=A0=A0 (setq org-babel-C++-compiler "= g++ -std=3Dc++0x")=0A=0AThis got me to wondering if there were any similar = hooks that relate to=0Arunning the program once it's compiled.=A0 I looked = through the list of=0Aorg-babel* variables, but didn't find anything obviou= s.=0A=0ASo what does happen when I hit C-c C-c in, say, a cpp source-code b= lock?=A0 The=0Acontents of the file are evidently written to a temporary fi= le, after which=0Athe command specified by org-babel-C++-compiler is run on= that file.=A0 The=0Aresults of the compilation are stuck some place -- ano= ther temporary file, I=0Asuppose.=A0 Then the second, executable file is ru= n and the results collected.=0AWhat command runs the file?=A0 Is there any = control from Org-mode over this=0Asecond stage of the process?=0A=0AThanks,= =0A=0A-- Mike