I have this working on my testing environment, but I guess I can't figure out how I did it. Basically, I'm trying to compile a MySQL UDF that uses functions from RHash, but I'm getting this from the MySQL server
Error Code: 1126. Can't open shared library 'sha3.so' (errno: 0 /usr/lib/mysql/plugin/sha3.so: undefined symbol: rhash_msg)
On the server I've run these
apt install rhash librhash-dev
And I've even downloaded the source (only because it wasn't yet working) from https://github.com/rhash/RHash and run
./configure
make test
make install
Which doesn't seem to give me any errors, and then I compile with
gcc -I/usr/include/mysql -lrhash -o sha3.so -shared sha3.c -fPIC
Which ALSO doesn't give any errors, but then I get that MySQL error when running
create function`sha3`returns string soname'sha3.so';
What step am I doing wrong here?
Just in case, my source is here https://gist.github.com/BrianLeishman/a0f40e7a0a87a7069c5c56a768ff3179
I've seen this answer What is an undefined reference/unresolved external symbol error and how do I fix it?, but I'm pretty sure I already have the order of arguments set correctly, but maybe I'm wrong, since all of their examples talk about setting the output before the link, which is definitely not what I'm doing here.