0

I am just starting out with Pybind11 for python bindings with C++ code. Using CMake, the C++ files having functionalities to be imported in python are compiled to a .so(shared library) file in Linux. My question is that after compilation do the .so file need the C++ compiler to be present in the system for my python program to use those functions? For e.g, if I just transferred the .so file to another Linux system with C++ installed and tried to import in a python file, will it work?

3
  • No. The dynamic linker (ld.so) is responsible for loading libraries as needed. A C++ compiler is only one way to generate these libraries. Commented Oct 12, 2022 at 8:18
  • But my question was whether that linker is depended on C++ installation? Commented Oct 12, 2022 at 9:36
  • 1
    It is not. The dynamic loader is an integral part of the operating system and has nothing to do with a C++ compiler. Commented Oct 12, 2022 at 18:25

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.