<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div style="font-size: 16.3636360168457px;" data-mce-style="font-size: 16.3636360168457px;"><span style="font-size: 16.3636360168457px;">The problem is solved, as you explained I had to update the ldconf cache.</span></div><div style="font-size: 16.3636360168457px;" data-mce-style="font-size: 16.3636360168457px;">I guess that I didn't get any issues with the direct compilation of the example because I was building an executable file and not a shared library.</div><div><div style="font-size: 16.3636360168457px;" data-mce-style="font-size: 16.3636360168457px;">Thanks a lot for taking the time to explain  the key aspects.</div><div><br></div></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>De: </b>"Dirk Eddelbuettel" <edd@debian.org><br><b>À: </b>"Marie-Pierre ETIENNE" <marie.etienne@agroparistech.fr><br><b>Cc: </b>"Dirk Eddelbuettel" <edd@debian.org>, rcpp-devel@lists.r-forge.r-project.org<br><b>Envoyé: </b>Vendredi 1 Mai 2015 22:30:09<br><b>Objet: </b>Re: [Rcpp-devel] Linking Rcpp and libcmaes within a package<br><div><br></div><br>On 1 May 2015 at 19:03, Marie-Pierre ETIENNE wrote:<br>| So I tried to apply your suggestion and I still have the same error<br>|  <br>| Error in dyn.load(file, DLLpath = DLLpath, ...) :  unable to load shared object '/home/metienne/R/x86_64-pc-linux-gnu-library/3.1/testCMaes/libs/testCMaes.so': libcmaes.so.0: cannot open shared object file: No such file or directory Error: loading failed <br>| <br>| I'm absolutely not confortable with this, so I wonder if libcmaes.so.0 should<br>|  be copied in the<br>| <br>| testCMaes package installation directory  or should testCMaes.so access to it in the standard directory ?<br><div><br></div>It depends.  <br><div><br></div>In the simplest case, you just have /usr/local/lib/libcmaes.so and after<br>running 'sudo ldconfig' (to update the ldconf cache) you should see it when<br>you do 'ldconfig -p | grep cmaes'.<br><div><br></div>When libraries are installed by the distribution, you often get something<br>like this:<br><div><br></div>edd@max:~$ ls -l /usr/lib/libgsl.so*<br>lrwxrwxrwx 1 root root      16 Jul 10  2014 /usr/lib/libgsl.so -> libgsl.so.0.17.0<br>lrwxrwxrwx 1 root root      16 Jul 10  2014 /usr/lib/libgsl.so.0 -> libgsl.so.0.17.0<br>-rw-r--r-- 1 root root 2221616 Jul 10  2014 /usr/lib/libgsl.so.0.17.0 <br>edd@max:~$ <br><div><br></div>So it depends on where you got libcmaes from, and how you installed it.<br><div><br></div>None of this has anything to do with Rcpp. You are simply trying to figire<br>out how to work with a local library. <br><div><br></div>And you will have the same issue in 5-line C program against the cmaes<br>library.  So I would suggest you seek some help from a more experienced<br>programmer around you at Agro Paris, and come back when you can build and run<br>a simple C program/<br><div><br></div>Dirk<br><div><br></div>-- <br>http://dirk.eddelbuettel.com | @eddelbuettel | edd@debian.org<br></div><div><br></div></div></body></html>