From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Hannon Subject: Re: Problem compiling C++ in Org-mode Date: Fri, 18 Nov 2011 21:13:42 -0800 (PST) Message-ID: <1321679622.97301.YahooMailNeo@web161906.mail.bf1.yahoo.com> References: <1321592202.64015.YahooMailNeo@web161913.mail.bf1.yahoo.com> <87wraxanis.fsf@avasys.jp> <1321605584.56574.YahooMailNeo@web161909.mail.bf1.yahoo.com> <1321646363.68187.YahooMailNeo@web161909.mail.bf1.yahoo.com> <80k46x82f2.fsf@somewhere.org> Reply-To: Michael Hannon 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]:43440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RRdFL-0007Xx-HH for emacs-orgmode@gnu.org; Sat, 19 Nov 2011 00:13:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RRdFK-0004Fj-Ez for emacs-orgmode@gnu.org; Sat, 19 Nov 2011 00:13:47 -0500 Received: from nm36-vm0.bullet.mail.bf1.yahoo.com ([72.30.238.136]:33926) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RRdFK-0004Ff-AY for emacs-orgmode@gnu.org; Sat, 19 Nov 2011 00:13:46 -0500 In-Reply-To: <80k46x82f2.fsf@somewhere.org> 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: Sebastien Vauban , "emacs-orgmode@gnu.org" =0A=0A> From: Sebastien Vauban =0A>> Just for t= he record, adding the following to my .emacs file seems to solve=0A>> the p= roblem I was having, where the C++ compiler was compiling a source=0A>> blo= ck (written=C2=A0 to a temporary file in /tmp/...) and was unable to find a= n=0A>> include file in the current working directory:=0A>>=0A>> (setq org-b= abel-C++-compiler=0A>>=C2=A0=C2=A0=C2=A0=C2=A0 (concat "g++ -std=3Dc++0x "= =0A>>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 "-I"=0A>>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (expand-file-name ".")=0A>>=C2=A0=C2=A0=C2=A0=C2=A0 )=0A>> )= =0A=0A> Your previous version contained "-I~/...". I don't know why you cha= nged it,=0A> but this could eventually enlighten you:=0A> =0A>=C2=A0=C2=A0= =C2=A0=C2=A0 =E2=94=8F=E2=94=81=E2=94=81=E2=94=81=E2=94=81[ from Cygwin's M= L]=0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94=83 "If a word begins with an unquoted= tilde character (`~'), all of the=0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94=83 ch= aracters up to the first unquoted slash (or all characters, if there=0A>=C2= =A0=C2=A0=C2=A0=C2=A0 =E2=94=83 is no unquoted slash) are considered a TILD= E-PREFIX."=0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94=83=0A>=C2=A0=C2=A0=C2=A0=C2= =A0 =E2=94=83 Note "word begins". I've been bitten by this in a makefile:= =0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94=83=0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94= =83 OPENSSL_DIR :=3D ~/lib/openssl=0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94=83 CP= PFLAGS :=3D -I$(OPENSSL_DIR)=0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94=83=0A>=C2= =A0=C2=A0=C2=A0=C2=A0 =E2=94=83 The gcc command line then contained -I~/lib= /openssl, and the ~ was not=0A>=C2=A0=C2=A0=C2=A0=C2=A0 =E2=94=83 expanded = by the shell. ${HOME}/lib/openssl would have worked.=0A>=C2=A0=C2=A0=C2=A0= =C2=A0 =E2=94=97=E2=94=81=E2=94=81=E2=94=81=E2=94=81=0A> =0A=0AHi, Seb.=C2= =A0 Thanks for the heads-up.=C2=A0 The version that I have now seems to wor= k,=0Abut, just FYI, the explanation for the change of syntax is explained i= n the=0Alittle dialogue that I had with myself:=0A=0AHmm, to get this thing= to compile, I have to tack on some "-I..." stuff to my=0Ag++ command.=C2= =A0 This is tedious.=C2=A0 How can I do this automatically?=0A=0AI'll bet I= know: there must be some way to concatenate strings in Emacs lisp.=0A=0A(G= oogle search for some terms vaguely related to "Emacs lisp concatenate".)= =0A=0A(Look at one of the Google hits and stumble across an example that tu= rns out=0Ato use "expand-file".)=0A=0AWhat do you suppose expand-file does?= =C2=A0 (Try it.)=C2=A0 Cool!=0A=0A(Break from problem-solving loop)=0A=0A--= Mike