You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since upgrading to Pybind11 v3.0.0, I'm unable to compile my Python module if I include any Qt header. I’ve created a minimal reproducible example below. It compiles fine without the Qt include, but fails when any Qt header is present (e.g. #include <QWidget>).
Should I open a formal issue for this?
main.cpp
#include<pybind11/pybind11.h>
#include<QWidget>namespacepy= pybind11;
PYBIND11_MODULE(test, m) {
}
-- pybind11 v3.0.0
-- Found Python: /home/tipbs/.pyenv/shims/python3 (found suitable version "3.13.5", minimum required is "3.8") found components: Interpreter Development.Module Development.Embed
Using compatibility mode for Python, set PYBIND11_FINDPYTHON to NEW/OLD to silence this message
-- Found Python: /home/tipbs/.pyenv/shims/python3 (found version "3.13.5") found components: Interpreter
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /home/tipbs/py_qt_test/build
[ 0%] Built target test_autogen_timestamp_deps
[ 25%] Automatic MOC and UIC for target test
[ 25%] Built target test_autogen
[ 50%] Building CXX object CMakeFiles/test.dir/main.cpp.o
Dans le fichier inclus depuis /home/tipbs/py_qt_test/build/_deps/pybind11-src/include/pybind11/attr.h:13,
depuis /home/tipbs/py_qt_test/build/_deps/pybind11-src/include/pybind11/detail/class.h:12,
depuis /home/tipbs/py_qt_test/build/_deps/pybind11-src/include/pybind11/pybind11.h:12,
depuis /home/tipbs/py_qt_test/main.cpp:1:
/home/tipbs/py_qt_test/main.cpp: In function« PyObject*PyInit_test() »:
/home/tipbs/py_qt_test/main.cpp:6:1: erreur: expected unqualified-id before « = » token
6 | PYBIND11_MODULE(test, m) {
| ^~~~~~~~~~~~~~~
/home/tipbs/py_qt_test/main.cpp:6:1: erreur: expected primary-expression before « . » token
6 | PYBIND11_MODULE(test, m) {
| ^~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/test.dir/build.make:93: CMakeFiles/test.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:112: CMakeFiles/test.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, and thank you for the 3.0.0 release!
Since upgrading to Pybind11 v3.0.0, I'm unable to compile my Python module if I include any Qt header. I’ve created a minimal reproducible example below. It compiles fine without the Qt include, but fails when any Qt header is present (e.g.
#include <QWidget>
).Should I open a formal issue for this?
main.cpp
CMakeLists.txt
Console output
Beta Was this translation helpful? Give feedback.
All reactions