← Back to team overview

yade-dev team mailing list archive

Re: How to use a plugin

 

> Thanks Vaclav.  Yes, I have included Scene and Omega in the header.  After some trial and error, this works:
> Scene* scene = Omega::instance().getScene().get();
> Is it different from the previous: shared_ptr<Scene> scene = Omega()::instance().getScene() ?
AHH! Omega() doesn't work. isntance is static method, so you have no
parentheses: Omega::instance() rather than Omega()::instance.

> Another weird error I got is this, although I've included the path in LIBPATH and CPPPATH:
> 13    FATAL yade.Omega /home/chiab/yadeNew/Branch6/core/Omega.cpp:229 loadPlugins: /home/chiab/yadeNew/YADEb6/lib/yade-b6/extra/libCWBoonPlugin3.so: libnagc_nag.so: cannot open shared object file: No such file or directory
> 
> I did a check:
> chiab@engs-018383:/usr/local/NAG/cll6a09dhl/lib$ ls -l libnagc_nag.so
> lrwxrwxrwx 1 root root 19 2010-04-07 11:10 libnagc_nag.so -> ./libnagc_nag.so.09

man ld; man ld.so (look for "rpath")

Try
"ldd /home/chiab/yadeNew/YADEb6/lib/yade-b6/extra/libCWBoonPlugin3.so"
as well. (man ldd if in doubt what it does)

LIBPATH only makes _linker_ find the library at link-time, but it has
nothing to do with _run-time_ seach path. You can add
RPATH=env['RPATH']+['.'] to plugin compilation options (to make it look
for its libs in the directory of the plugin itself ('.'), or you can
(should) install the lib in standard paths, such as /usr/local/lib. Or,
you can specify dir with the lib in LD_LIBRARY_PATH (man ld.so, which is
the program finding libraries at run-time, when you run the program or
load the plugin)


HTH, Vaclav




Follow ups

References