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?

cigien
  • 57,834
  • 11
  • 73
  • 112
Tarique
  • 463
  • 3
  • 16
  • No. The dynamic linker (ld.so) is responsible for loading libraries as needed. A C++ compiler is only one way to *generate* these libraries. – Botje Oct 12 '22 at 08:18
  • But my question was whether that linker is depended on C++ installation? – Tarique Oct 12 '22 at 09: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. – Botje Oct 12 '22 at 18:25

0 Answers0