From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Meeuwissen Subject: Re: Problem compiling C++ in Org-mode Date: Fri, 18 Nov 2011 16:38:19 +0900 Message-ID: <87wraxanis.fsf@avasys.jp> References: <1321592202.64015.YahooMailNeo@web161913.mail.bf1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRJ1p-00057X-Iu for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 02:38:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRJ1o-00006y-Bu for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 02:38:29 -0500 Received: from ekc4.avasys.jp ([210.228.20.165]:48194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRJ1o-00006L-2K for emacs-orgmode@gnu.org; Fri, 18 Nov 2011 02:38:28 -0500 In-Reply-To: <1321592202.64015.YahooMailNeo@web161913.mail.bf1.yahoo.com> (Michael Hannon's message of "Thu, 17 Nov 2011 20:56:42 -0800 (PST)") 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: Michael Hannon Cc: Org-Mode List Michael Hannon writes: > Greetings.=C2=A0 I'm having a problem compiling a C++ source-code block in > Org-mode.=C2=A0 The same C++ code compiles and runs in the shell. > > The issue seems to relate to local include files. [...snip...] > What am I missing? > /tmp/babel-245846_d/C-src-24584NIQ.cpp:7:26: fatal error: OtherStuff.cpp:= No > such file or directory > compilation terminated. > /bin/bash: /tmp/babel-245846_d/C-bin-24584aSW: Permission denied Compilation is taking place in a temporary directory, miles away from where your org file lives. > ########## Org-mode compile uses same option as shell compile: > > org-babel-C++-compiler is a variable defined in `ob-C.el'. > Its value is "g++ -std=3Dc++0x" The current directory is not specified in the include path. You would need to add a -I option to set the (absolute path to the) directory the org file is in. If you have all your org files in ~/org, you could try "g++ -std=3Dc++0x -I~/org". Hope this helps, --=20 Olaf Meeuwissen, LPIC-2 FLOSS Engineer -- AVASYS CORPORATION FSF Associate Member #1962 Help support software freedom http://www.fsf.org/jf?referrer=3D1962