Linking static library into R

不打扰是莪最后的温柔 提交于 2019-12-08 02:59:49

问题


I have a static library which I am trying to use inside my R package. This is only for internal use.

The libq.a for now is just within ./src folder. I was trying to add the following to src/Makevars:

PKG_LIBS="-l/path/to/lib/libq.a"

Where /path/to/lib is an absolute path to the libq.a location (for testing purposes only). But that doesn't seem to help. Do I have to do anything else in order to load that static library?


回答1:


That should work -- make sure you see the library used on the final link statement when the package is built. Mind you, though, that -L is for the patch and -lq should be all.

Static libraries can also be added directly so try /path/to/lib/libq.a as is as an argument to PKG_LIBS.



来源:https://stackoverflow.com/questions/12781518/linking-static-library-into-r

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!