emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Hannon <jm_hannon@yahoo.com>
To: Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>,
	"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Problem compiling C++ in Org-mode
Date: Fri, 18 Nov 2011 21:13:42 -0800 (PST)	[thread overview]
Message-ID: <1321679622.97301.YahooMailNeo@web161906.mail.bf1.yahoo.com> (raw)
In-Reply-To: <80k46x82f2.fsf@somewhere.org>



> From: Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>
>> Just for the record, adding the following to my .emacs file seems to solve
>> the problem I was having, where the C++ compiler was compiling a source
>> block (written  to a temporary file in /tmp/...) and was unable to find an
>> include file in the current working directory:
>>
>> (setq org-babel-C++-compiler
>>     (concat "g++ -std=c++0x "
>>             "-I"
>>             (expand-file-name ".")
>>     )
>> )

> Your previous version contained "-I~/...". I don't know why you changed it,
> but this could eventually enlighten you:
> 
>     ┏━━━━[ from Cygwin's ML]
>     ┃ "If a word begins with an unquoted tilde character (`~'), all of the
>     ┃ characters up to the first unquoted slash (or all characters, if there
>     ┃ is no unquoted slash) are considered a TILDE-PREFIX."
>     ┃
>     ┃ Note "word begins". I've been bitten by this in a makefile:
>     ┃
>     ┃ OPENSSL_DIR := ~/lib/openssl
>     ┃ CPPFLAGS := -I$(OPENSSL_DIR)
>     ┃
>     ┃ The gcc command line then contained -I~/lib/openssl, and the ~ was not
>     ┃ expanded by the shell. ${HOME}/lib/openssl would have worked.
>     ┗━━━━
> 

Hi, Seb.  Thanks for the heads-up.  The version that I have now seems to work,
but, just FYI, the explanation for the change of syntax is explained in the
little dialogue that I had with myself:

Hmm, to get this thing to compile, I have to tack on some "-I..." stuff to my
g++ command.  This is tedious.  How can I do this automatically?

I'll bet I know: there must be some way to concatenate strings in Emacs lisp.

(Google search for some terms vaguely related to "Emacs lisp concatenate".)

(Look at one of the Google hits and stumble across an example that turns out
to use "expand-file".)

What do you suppose expand-file does?  (Try it.)  Cool!

(Break from problem-solving loop)

-- Mike

      reply	other threads:[~2011-11-19  5:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18  4:56 Problem compiling C++ in Org-mode Michael Hannon
2011-11-18  7:38 ` Olaf Meeuwissen
2011-11-18  8:39   ` Michael Hannon
2011-11-18  9:32     ` Olaf Meeuwissen
2011-11-18 19:59     ` Michael Hannon
2011-11-18 20:16       ` Eric Schulte
2011-11-18 22:57       ` Sebastien Vauban
2011-11-19  5:13         ` Michael Hannon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1321679622.97301.YahooMailNeo@web161906.mail.bf1.yahoo.com \
    --to=jm_hannon@yahoo.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wxhgmqzgwmuf@spammotel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).