From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: [babel] dynamic linking in user directory not working for C++ language Date: Tue, 28 Jan 2014 19:59:09 +0100 Message-ID: <52E7FDFD.5030006@free.fr> References: <52E7B7F1.8080107@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8DsW-0004Wv-Bm for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 13:59:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8DsV-0002xK-CE for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 13:59:20 -0500 Received: from smtp5-g21.free.fr ([2a01:e0c:1:1599::14]:33912) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8DsU-0002wp-Hf for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 13:59:19 -0500 Received: from [IPv6:2a01:e35:2e21:def0:d01f:3def:f344:f811] (unknown [IPv6:2a01:e35:2e21:def0:d01f:3def:f344:f811]) by smtp5-g21.free.fr (Postfix) with ESMTP id 9CCB5D4809A for ; Tue, 28 Jan 2014 19:59:10 +0100 (CET) In-Reply-To: <52E7B7F1.8080107@gmail.com> 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: emacs-orgmode@gnu.org Le 28/01/2014 15:00, Benoit Bayol a =E9crit : > Hello everyone :) > > I have a problem that I cannot fix when compiling a C++ source block. > > My code block use several libraries and especially one named > libarmadillo.dylib which is installed in a non-default place. > > My code compiles well in the buffer shell of emacs with : > g++ -I/Users/benoitbayol/libs/include > /Users/benoitbayol/libs/lib/libboost_system.a > /Users/benoitbayol/libs/lib/libboost_chrono.a > /Users/benoitbayol/libs/lib/libboost_thread.a > -L/Users/benoitbayol/libs/lib -larmadillo main.cpp > > but if I copy paste these flags and put them in : > #+begin_src C++ flags : -I/Users/benoitbayol/libs/include > /Users/benoitbayol/libs/lib/libboost_system.a > /Users/benoitbayol/libs/lib/libboost_chrono.a > /Users/benoitbayol/libs/lib/libboost_thread.a > -L/Users/benoitbayol/libs/lib -larmadillo > > The compilation process with babel complains about a dylib > (libarmadillo.3.dylib) which cannot be found with : > dyld: Library not loaded: libarmadillo.3.dylib > Referenced from: > /var/folders/xh/vvf5bjg15c3_rn5kdb4d2lk40000gn/T/babel-329218a6/C-bin-3= 2921x5m > Reason: image not found > > In the /Users/benoitbayol/libs/lib folder I have > -rwxr-xr-x 1 benoitbayol staff 41592 28 jan 14:03 > libarmadillo.3.92.2.dylib > lrwxr-xr-x 1 benoitbayol staff 25 28 jan 14:03 > libarmadillo.3.dylib -> libarmadillo.3.92.2.dylib > lrwxr-xr-x 1 benoitbayol staff 20 28 jan 14:03 > libarmadillo.dylib -> libarmadillo.3.dylib > > I tried to fix my .emacs with (setq org-babel-C++-compiler "g++ > -L/Users/benoitbayol/libs/lib") but I doesn't work. > > Does anybody have an idea ? > > Thanks :) > Maybe it is just a miss-placed colon. Try #+begin_src C++ :flags -I/Users/benoitbayol/libs/include etc... instead of #+begin_src C++ flags : -I/Users/benoitbayol/libs/include etc...