[Rcpp-devel] Rcpp + Package -> undefined symbol

Qiang Kou qkou at umail.iu.edu
Wed Aug 2 22:42:24 CEST 2017


Hi, Michael,

All the ".cc" files need to be compiled to make your package work. Putting
them in the inst/include folder is not enough.

I made some quick changes in your package and please check the attachment.

Best,

Qiang Kou

On Wed, Aug 2, 2017 at 11:22 AM, Michaël BENESTY <michael at benesty.fr> wrote:

> Hi,
>
> I am trying to wrap the Fasttext lib from Facebook on R.
> I have wrote a minimal code based on Rcpp.package.skeleton(module = TRUE)
>
> The C++ file compiles/works with sourceCpp() but it crashes when
> building a package.
> I have checked many D. Eddelbuettel to get a clue of what to do but no
> luck.
> I have already setup a Makevars file with a path to the include folder.
>
> The package source code is available there:
> https://github.com/pommedeterresautee/FastRText
>
> My Makevars:
> CXX_STD = CXX11
> ROOT_INCLUDE = ../inst/include/
> PKG_CPPFLAGS=-I$(ROOT_INCLUDE)
>
>
> The error I am seeing:
> ==> R CMD INSTALL --preclean --no-multiarch --with-keep.source FastRText
> ...
> Error: package or namespace load failed for ‘FastRText’ in
> dyn.load(file, DLLpath = DLLpath, ...):
>  impossible de charger l'objet partagé
> '/home/geantvert/R/x86_64-pc-linux-gnu-library/3.4/
> FastRText/libs/FastRText.so':
>   /home/geantvert/R/x86_64-pc-linux-gnu-library/3.4/
> FastRText/libs/FastRText.so:
> undefined symbol: _ZN8fasttext8FastTextC1Ev
>
>
> The full log is available there:
> https://github.com/pommedeterresautee/FastRText/issues/1
>
> According to c++filt
> undefined symbol: _ZN8fasttext8FastTextC1Ev means ->
> fasttext::FastText::FastText()
>
>
> Has anyone an idea?
>
> Kind regards,
> Michaël
> ________________
> Michaël BENESTY
> michael at benesty.fr
> Please do not print this e-mail unless you really need to.
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel




-- 
Qiang Kou
qkou at umail.iu.edu
School of Informatics and Computing, Indiana University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170802/086790bf/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FastRText_1.0.tar.gz
Type: application/x-gzip
Size: 23356 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170802/086790bf/attachment-0001.bin>


More information about the Rcpp-devel mailing list