Hi
I have a c++ root code that I want to compile it, make a shared library and use it in a python code.
I am using ROOT 6.32. My c++ code basically just use TRandom3 and TF1, and I am trying to compile this way:
g++ -c -L/usr/local/lib -I/usr/local/include -Iinterface/ src/TrigEmulatorTool.cc src/TrigEmulator.cc -fPIC -std=c++20
g++ -shared -o TrigEmulatorTool.so TrigEmulatorTool.o
and I get a shared library TrigEmulatorTool.so
without errors.
However, when I tried to load this library in python, just like:
import ctypes
ctypes.cdll.LoadLibrary("/srv/src/TriggerEmulator/TrigEmulatorTool.so")
I am getting this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "/usr/local/lib/python3.10/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /srv/src/TriggerEmulator/TrigEmulatorTool.so: undefined symbol: _ZN4Vc_16Common11RandomStateE
Any idea what can be the reason?
cheers
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.32.02
Platform: Linux
Compiler: linuxx8664gcc