自己开发的插件不能加载,报错Couldn't load the dynamic library

我自己按DolphinDB的插件教程开发了一个插件,但在loadPlugin时提示:

2020-07-14T02:10:05.505: execution was completed with exception
Couldn't load the dynamic library [/mnt/hgfs/releaseMaster/DolphinDBPlugin/demo/libPluginDemo.so]: /mnt/hgfs/releaseMaster/DolphinDBPlugin/demo/libPluginDemo.so: symbol _ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED1Ev, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

我的编译命令如下:

cd demo
g++ -DLINUX -fPIC -std=c++11 -c src/Demo.cpp -I../include -o Demo.o
g++ -fPIC -shared -o libPluginDemo.so Demo.o -lDolphinDB -L/home/xjqian/database/DolphinDB_Linux64_V1.20.0/server

请问可能是什么原因?

阅读 2.8k
1 个回答

可能是你采用了 -std=c++11标准的问题,造成了命名空间(模块)命名问题,因为现在报的错是 相应的一个模块在libstdc++.so.6中找不到。
可能就是ABI不兼容的问题,在官方的介绍中也提到了这个问题的。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题