From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hannon Subject: Problem compiling C++ in Org-mode Date: Thu, 17 Nov 2011 20:56:42 -0800 (PST) Message-ID: <1321592202.64015.YahooMailNeo@web161913.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]:51010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRGVJ-0006ru-Gz for emacs-orgmode@gnu.org; Thu, 17 Nov 2011 23:56:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRGVH-0001HY-RX for emacs-orgmode@gnu.org; Thu, 17 Nov 2011 23:56:45 -0500 Received: from nm1.bullet.mail.bf1.yahoo.com ([98.139.212.160]:30881) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RRGVH-0001HT-Nf for emacs-orgmode@gnu.org; Thu, 17 Nov 2011 23:56:43 -0500 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 Greetings.=A0 I'm having a problem compiling a C++ source-code block in=0AO= rg-mode.=A0 The same C++ code compiles and runs in the shell.=0A=0AThe issu= e seems to relate to local include files.=A0 I.e., a program that=0Ainclude= s only standard files, such as:=0A=0A=A0=A0=A0 #include =0A=0Awor= ks fine.=A0 But Org-mode seems to be unable to find a file included from th= e=0Acurrent directory, such as:=0A=0A=A0=A0=A0 #include "OtherStuff.cpp"=0A= =0AI've appended the Org source code and associated error message.=0A=0AI'v= e also appended the log of a successful compilation of the same source code= =0Ain the shell, as well as the details of my configuration.=0A=0AWhat am I= missing?=0A=0AThanks,=0A=0A-- Mike=0A=0A=0A=0A=0A########## Unsuccessful a= ttempt to compile in Org-mode=0A=0A* Test=0A=0A#+begin_src cpp=0A=A0=A0=A0 = =0A=A0 #include =0A=A0 #include =0A=A0 #include "OtherStu= ff.cpp"=0A=A0 =0A=A0 using namespace std;=0A=A0 =0A=A0 int main() {=0A=A0 = =0A=A0=A0=A0 cout << "Hello!" << endl;=0A=A0 =0A=A0 }=0A=A0=A0=A0 =0A#+end_= src=0A=0A#+results:=0A=0A=0A/tmp/babel-245846_d/C-src-24584NIQ.cpp:7:26: fa= tal error: OtherStuff.cpp: No=0Asuch file or directory=0Acompilation termin= ated.=0A/bin/bash: /tmp/babel-245846_d/C-bin-24584aSW: Permission denied=0A= =0A########## Successful compilation in linux shell=0A=0A$ cat junk.cpp=0A#= include =0A#include =0A#include "OtherStuff.cpp"=0A=0Ausi= ng namespace std;=0A=0Aint main() {=0A=0A=A0 cout << "Hello!" << endl;=0A= =0A}=0A$ g++ -o junk -std=3Dc++0x junk.cpp=0A=0A$ ./junk=0AHello!=0A=0A####= ###### Org-mode compile uses same option as shell compile:=0A=0Aorg-babel-C= ++-compiler is a variable defined in `ob-C.el'.=0AIts value is "g++ -std=3D= c++0x"=0A=0ADocumentation:=0ACommand used to compile a C++ source code file= into an=0A=A0 executable.=0A=0A########## My configuration=0A=0AEmacs=A0 := GNU Emacs 23.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.5)=0A=A0of 20= 11-06-29 on x86-01.phx2.fedoraproject.org=0APackage: Org-mode version 7.7 (= release_7.7.328.g1a97.dirty)