<div dir="ltr">Hi, Michael,<div><br></div><div>All the ".cc" files need to be compiled to make your package work. Putting them in the inst/include folder is not enough.</div><div><br></div><div>I made some quick changes in your package and please check the attachment.</div><div><br></div><div>Best,</div><div><br></div><div>Qiang Kou</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 2, 2017 at 11:22 AM, Michaël BENESTY <span dir="ltr"><<a href="mailto:michael@benesty.fr" target="_blank">michael@benesty.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am trying to wrap the Fasttext lib from Facebook on R.<br>
I have wrote a minimal code based on Rcpp.package.skeleton(module = TRUE)<br>
<br>
The C++ file compiles/works with sourceCpp() but it crashes when<br>
building a package.<br>
I have checked many D. Eddelbuettel to get a clue of what to do but no luck.<br>
I have already setup a Makevars file with a path to the include folder.<br>
<br>
The package source code is available there:<br>
<a href="https://github.com/pommedeterresautee/FastRText" rel="noreferrer" target="_blank">https://github.com/<wbr>pommedeterresautee/FastRText</a><br>
<br>
My Makevars:<br>
CXX_STD = CXX11<br>
ROOT_INCLUDE = ../inst/include/<br>
PKG_CPPFLAGS=-I$(ROOT_INCLUDE)<br>
<br>
<br>
The error I am seeing:<br>
==> R CMD INSTALL --preclean --no-multiarch --with-keep.source FastRText<br>
...<br>
Error: package or namespace load failed for ‘FastRText’ in<br>
dyn.load(file, DLLpath = DLLpath, ...):<br>
 impossible de charger l'objet partagé<br>
'/home/geantvert/R/x86_64-pc-<wbr>linux-gnu-library/3.4/<wbr>FastRText/libs/FastRText.so':<br>
  /home/geantvert/R/x86_64-pc-<wbr>linux-gnu-library/3.4/<wbr>FastRText/libs/FastRText.so:<br>
undefined symbol: _ZN8fasttext8FastTextC1Ev<br>
<br>
<br>
The full log is available there:<br>
<a href="https://github.com/pommedeterresautee/FastRText/issues/1" rel="noreferrer" target="_blank">https://github.com/<wbr>pommedeterresautee/FastRText/<wbr>issues/1</a><br>
<br>
According to c++filt<br>
undefined symbol: _ZN8fasttext8FastTextC1Ev means -><br>
fasttext::FastText::FastText()<br>
<br>
<br>
Has anyone an idea?<br>
<br>
Kind regards,<br>
Michaël<br>
________________<br>
<span class="HOEnZb"><font color="#888888">Michaël BENESTY<br>
<a href="mailto:michael@benesty.fr">michael@benesty.fr</a><br>
Please do not print this e-mail unless you really need to.<br>
______________________________<wbr>_________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-<wbr>project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" rel="noreferrer" target="_blank">https://lists.r-forge.r-<wbr>project.org/cgi-bin/mailman/<wbr>listinfo/rcpp-devel</a></font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Qiang Kou<div><a href="mailto:qkou@umail.iu.edu" target="_blank">qkou@umail.iu.edu</a><br><div>School of Informatics and Computing, Indiana University</div><div><br></div></div></div></div>
</div>