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