pybind / cmake_example

Example pybind11 module built with a CMake-based build system
Other
616 stars 218 forks source link

Failed to import cmake_example #71

Open FantasyVR opened 2 years ago

FantasyVR commented 2 years ago

After successfully installing cmake_example after running pip install . command. I try to import cmake_example module, but it shows undefined symbol

(pybind11) xx@xx:~/code/cmake_example$ pip install . --user
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Processing /home/py/code/cmake_example
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: cmake-example
  Building wheel for cmake-example (pyproject.toml) ... done
  Created wheel for cmake-example: filename=cmake_example-0.0.1-cp38-cp38-linux_x86_64.whl size=48911 sha256=9ebbda22de67d214c2039da9003236fe2d8e8eda90c4e2bbee1f4fa7778d7aa5
  Stored in directory: /tmp/pip-ephem-wheel-cache-jcrqt4zq/wheels/15/39/14/4a8a39410655bf49353e750dd2e25ce81174f227c1bbb4635b
Successfully built cmake-example
Installing collected packages: cmake-example
Successfully installed cmake-example-0.0.1
(pybind11) xx@xx::~/code/cmake_example$ python
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cmake_example as m
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /home/py/.local/lib/python3.8/site-packages/cmake_example.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZTVN10__cxxabiv120__si_class_type_infoE