emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Problem compiling C++ in Org-mode


From: Olaf Meeuwissen
Subject: Re: [O] Problem compiling C++ in Org-mode
Date: Fri, 18 Nov 2011 16:38:19 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Michael Hannon <address@hidden> writes:

> Greetings.  I'm having a problem compiling a C++ source-code block in
> Org-mode.  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=c++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=c++0x -I~/org".

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962



reply via email to

[Prev in Thread] Current Thread [Next in Thread]