emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] dynamic linking in user directory not working for C++ language
@ 2014-01-28 14:00 Benoit Bayol
  2014-01-28 18:59 ` Thierry Banel
  0 siblings, 1 reply; 2+ messages in thread
From: Benoit Bayol @ 2014-01-28 14:00 UTC (permalink / raw)
  To: emacs-orgmode

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 :)

-- 
Benoît BAYOL
benoit.bayol@gmail.com
0033 6 3353 1153

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-01-28 18:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

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).