emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thierry Banel <tbanelwebmin@free.fr>
To: emacs-orgmode@gnu.org
Subject: Re: [babel] dynamic linking in user directory not working for C++ language
Date: Tue, 28 Jan 2014 19:59:09 +0100	[thread overview]
Message-ID: <52E7FDFD.5030006@free.fr> (raw)
In-Reply-To: <52E7B7F1.8080107@gmail.com>

Le 28/01/2014 15:00, Benoit Bayol a écrit :
> 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-32921x5m
>   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...

      reply	other threads:[~2014-01-28 18:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28 14:00 [babel] dynamic linking in user directory not working for C++ language Benoit Bayol
2014-01-28 18:59 ` Thierry Banel [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=52E7FDFD.5030006@free.fr \
    --to=tbanelwebmin@free.fr \
    --cc=emacs-orgmode@gnu.org \
    /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).