ERROR 1127(HY000):在库中找不到符号'add'。 [英] ERROR 1127 (HY000): can't find symbol 'add ' in library.

查看:128
本文介绍了ERROR 1127(HY000):在库中找不到符号'add'。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I have been looking for creating a user defined function in MariaDB to perform a simple task





< b>我尝试了什么:





What I have tried:

For that I created a sample c++ program for adding two numbers,and compiled using the below command
 g++ -fPIC -shared Hello.cc -o add.so
after that I copied the shared object file to plugin directory.







When Iam calling the Create function syntax 
 
CREATE FUNCTION add RETURNS integer SONAME 'add.so';

it gives the below error
 ERROR 1127 (HY000): Can't find symbol 'add ' in library.

Kindly give a solution for the same.

推荐答案

可能是由于 C ++ 函数名称修改。尝试用
Probably is due to C++ function name mangling. Try to surround function declaration with
extern "C" {
// your function declaration here...
}



例如,参见名称修改(仅限C ++) - IBM知识中心 [ ^ ]。


这篇关于ERROR 1127(HY000):在库中找不到符号'add'。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆