I am extending C++ library with functionality that requires GRPC. GRPC dependencies are added through VCPKG (example from CMakeLists.txt):
find_package(gRPC CONFIG REQUIRED)
target_link_libraries(
mylib PRIVATE
gRPC::grpc++)
Now, that same library has python bindings (where I enter into, for me, an uncharted territory).
The library is built through setuptools
. The setup itself initially went ok but when I try to load the library I get:
❯ python3
Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mylib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.8/dist-packages/mylib-0.0.0-py3.8-linux-x86_64.egg/mylib.cpython-38-x86_64-linux-gnu.so: undefined symbol: _ZTIN6google8protobuf2io20ZeroCopyOutputStreamE
Missing _ZTIN6google8protobuf2io20ZeroCopyOutputStreamE clearly comes from GRPC dependency. I tried playing with setup.py
and including grpc lib folder:
toolchain_args += ['-I/home/atomic/vcpkg/installed/x64-linux/lib']
I also tried extending required libraries list:
libraries += ['libgrpc++', 'libprotobuf']
Grpc is installed under /usr/local/lib/ and also as vcpkg package.
But without any luck. Including libs failed with following error:
/usr/bin/ld: cannot find -llibgrpc++
/usr/bin/ld: cannot find -llibprotobuf