pmem / libpmemobj-cpp

C++ bindings & containers for libpmemobj

Home Page:https://pmem.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

symbol pmemobj_set_user_data not define

weishuo2 opened this issue · comments

I called libpmembobj++ to write a dynamic library, and then used C# to call the dynamic library.
When running in C#, it appears: symbol pmemobj_set_user_data, version LIBPMEMOBJ_1.0 not defined in file libpmemobj.so.1 with link time reference .
I am curious what the problem is and how to solve it .Looking forward to your reply.

This function was added in libpmemobj 1.8, and your application is likely linking with something older.

g++ PMDKso_nvm.cpp -fPIC -shared -o PMDKso_nvm.so -L/usr/local/lib64 -lpmemobj -std=c++11
The version of libpmemobj under /usr/local/lib64 is 1.9,but this doesn't seem to work.
And I found that it was linking to libpmemobj installed by yum whose version is 1.5 .
Could you please tell me what should I do and when should I link it?

I found the problem and solved it ,Need to change LD_LIBRARY_PATH, it is useless to modify the link when compiling the dynamic library, because the lib called at runtime and the lib when compiling the dynamic library are not the same .
Thank you .