Hi, I am sure /home/GeV/work/hello/v1/src is the current and only work directory. $ ldd libMyClassDict.so linux-vdso.so.1 => (0x00007fff9e598000) libReflex.so.0 => /opt/root/lib/root/libReflex.so.0 (0x00007f7f2e4ec000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7f2e1d0000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7f2dfb9000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7f2dbfa000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7f2d9f6000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7f2d6f9000) /lib64/ld-linux-x86-64.so.2 (0x00007f7f2e98e000) All needed libraries exist. Errors occur only when I try to use automatic class loader. Best regards, Xia Xin 2013/5/25 <wlavrijsen@lbl.gov>:
Hi,
1.
$ echo $LD_LIBRARY_PATH /home/GeV/work/hello/v1/src:/opt/root/lib/root
$ ls /home/GeV/work/hello/v1/src libMyClassDict.rootmap libMyClassDict.so MyClass.h MyClass_rflx.cpp
import cppyy myinst = cppyy.gbl.MyClass(42)
Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: <class '__main__.::'> object has no attribute 'MyClass' (details: '<class '__main__.::'>' has no attribute 'MyClass')
2. TRY explicit load statements, Just as that Armin told me, It's OK, works perfectly
$ echo $LD_LIBRARY_PATH /opt/root/lib/root
import cppyy cppyy.load_reflection_info("./libMyClassDict.so") myinst = cppyy.gbl.MyClass(42)
42
3. Use LD_LIBRARY_PATH to clarify the path to libMyClassDict.so, still error
$ echo $LD_LIBRARY_PATH /home/GeV/work/hello/v1/src:/opt/root/lib/root
import cppyy cppyy.load_reflection_info("libMyClassDict.so")
Traceback (most recent call last): File "<stdin>", line 1, in <module> RuntimeError: libMyClassDict.so: cannot open shared object file: No such file or directory
I don't understand why the LD_LIBRARY_PATH did not work well on my PC.
neither do I, unless /home/GeV/work/hello/v1/src is not the current work directory and you have two libMyClassDict.so.
What does:
$ ldd /home/GeV/work/hello/v1/src/libMyClassDict.so
give? Any libraries to be linked not found?
Best regards,
Wim -- WLavrijsen@lbl.gov -- +1 (510) 486 6411 -- www.lavrijsen.net