Closed hanusek closed 5 months ago
Hi Michal,
I suspect the problem has nothing to do with Boost.Python, but rather with your CMake logic: As you are using the QOBJECT
macro in your FakeAuthThread
class, you need to process that code with Qt's moc
to generate (and subsequently compile) additional code. See https://cmake.org/cmake/help/latest/prop_tgt/AUTOMOC.html
I added:
set(CMAKE_AUTOMOC ON)
set_target_properties(my_lib_python_api PROPERTIES AUTOMOC TRUE)
And it works.
Hello! I have a problem with binding C++/Qt code to Python. When I import my library in Python:
ImportError: my_lib_python_api.so: undefined symbol: _ZTV14FakeAuthThread
I notice it's happening when I putQ_OBJECT
in my class (FakeAuthThread
). How to fix it?My example lib (file:
PythonClient.cpp
)CMakeLists.txt
ldd:
Qt version: 5.15.3 Boost version: 1.77.0 Python3_VERSION: 3.10.12 Python3_INCLUDE_DIRS: /usr/include/python3.10 Python3_LIBRARIES: /usr/lib/x86_64-linux-gnu/libpython3.10.so