Couple of comments: On 12 March 2013 at 09:13, 전희원 wrote: | Hi! All. | | I want to make R package with "http://code.google.com/p/uchardet/" library. | | But I encountered error. | | Executable file with -lchardet works well but shared library didn't work with | dyn.load() with Rcpp. | | Can any one give some tips? | | I temporally opened github repo for reproducible codes. | | https://github.com/haven-jeon/Ruchardet
You committed the .o and .so files to github, that makes no sense. Remove them. Few users will have the uchardet library installed, so few people will be able to help you. I suggest that you find a small comparable project that also uses Rcpp to connect to an external library. If you can't think of one, look eg at RcppGSL. | * installing *source* package ‘Ruchardet’ .. | ** libs | g++ -I/usr/share/R/include -DNDEBUG -I/usr/local/include -I/usr/include -I"/ | home/gogamza/R/x86_64-pc- | linux-gnu-library/2.15/Rcpp/include" -fpic -O2 -pipe -g -c | getCharEncoding.cpp -o getCharEncoding.o | g++ -shared -o Ruchardet.so getCharEncoding.o -L/home/gogamza/R/ | x86_64-pc-linux-gnu-library/2.15/Rcpp/lib -lRcpp -Wl,-rpath,/home/gogamza/R/ | x86_64- pc-linux-gnu-library/2.15/Rcpp/lib -L/usr/local/lib -L/usr/lib/ | -lstdc++ -luchardet -L/usr/lib/R/lib -lR | installing to /home/gogamza/work/Ruchardet.Rcheck/Ruchardet/libs | ** R | ** preparing package for lazy loading | ** help | *** installing help indices | ** building package indices | ** testing if installed package can be loaded | Error in dyn.load(file, DLLpath = DLLpath, ...) : | unable to load shared object '/home/gogamza/work/Ruchardet.Rcheck/Ruchardet/ | libs/Ruchardet.so': | /home/gogamza/work/Ruchardet.Rcheck/Ruchardet/libs/Ruchardet.so: undefined | symbol: uchardet_get_charset | Error: loading failed | Execution halted | ERROR: loading failed | * removing ‘/home/gogamza/work/Ruchardet.Rcheck/Ruchardet You have an issue with the linker not finding the uchardet_get_charset function: -- maybe it doesn't exist -- maybe you used the wrong signature (function types) -- maybe you just forgot 'extern "C"' around it. You will need to work that out. Again, the best example is probably somewhere between studying other small Rcpp-based packages, and trying small non-R / non-Rcpp based programs against uchardet. Hope this helps, Dirk | | | | My sessionInfo(). | | | R > sessionInfo() | R version 2.15.3 (2013-03-01) | Platform: x86_64-pc-linux-gnu (64-bit) | | locale: | [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=C LC_COLLATE=C | [5] LC_MONETARY=C LC_MESSAGES=C LC_PAPER=C LC_NAME=C | [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C LC_IDENTIFICATION=C | | attached base packages: | [1] stats graphics grDevices utils datasets methods base | | other attached packages: | [1] Rcpp_0.10.2 | | loaded via a namespace (and not attached): | [1] tools_2.15.3 | | Thanks. | | Heewon | | | ---------------------------------------------------------------------- | _______________________________________________ | Rcpp-devel mailing list | Rcpp-devel@lists.r-forge.r-project.org | https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel