rust-qt / ritual

Use C++ libraries from Rust
Apache License 2.0
1.22k stars 49 forks source link

Couldn't generate crate for qt_gui. #60

Closed o01eg closed 5 years ago

o01eg commented 6 years ago

rust version 1.21.0 clang 5.0.0. Qt 5.7.1 MS VS 2017

I deleted -fPIC flag so qt_core was generated successfully.

Generating crate: qt_gui
Loading dependencies
Loading files from D:\devel\qt-cache\qt_core
Running C++ parser
clang version 5.0.0 (tags/RELEASE_500/final)
Initializing clang...
Warning: CLANG_SYSTEM_INCLUDE_PATH environment variable is not set.
This may result in parse errors related to system header includes.
clang arguments: ["-Xclang", "-detailed-preprocessing-record", "-fcxx-exceptions
", "-std=c++14", "-I", "D:/Qt/Qt5.7.1/5.7/msvc2015_64/include", "-I", "D:/Qt/Qt5
.7.1/5.7/msvc2015_64/include\\QtGui", "-I", "D:/Qt/Qt5.7.1/5.7/msvc2015_64/inclu
de\\QtCore"]
Error:
   0: fatal clang error:
D:/Qt/Qt5.7.1/5.7/msvc2015_64/include\QtGui/qimage.h:275:62: error: rvalue refer
ence to type 'QImage' cannot bind to lvalue of type 'QImage'
D:/Qt/Qt5.7.1/5.7/msvc2015_64/include\QtGui/qimage.h:279:40: error: rvalue refer
ence to type 'QImage' cannot bind to lvalue of type 'QImage'
   1: C++ parser failed
error: process didn't exit successfully: `target\release\qt_generator.exe -c D:\
devel\qt-cache -C 3 -l all --debug-logging save -o D:\devel\qt-rust-test01\` (ex
it code: 1)
Riateche commented 6 years ago

The related Qt issue is marked as fixed in Qt 5.9.0. Does the generator work with Qt 5.9 for you?

o01eg commented 6 years ago

Yep, qt_gui successfully generated for Qt 5.9.2. I wonder if compatibility issues between dependencies should be noticed somewhere.

Riateche commented 6 years ago

Using clang on MSVC often produces issues. Some versions of clang even refuse to parse the standard library headers of some versions of MSVC.