Closed o01eg closed 6 years ago
Same for Gentoo Linux with: Rust: 1.19.0-dev (1d468400f 2017-05-11) and 1.16.0 Cargo: 0.20.0-dev (58fe1a8 2017-05-10) Clang: 3.9.1 tagret: x86_64-pc-linux-gnu Qt: 5.6.2
Thanks for the report! Looks like the generator couldn't generate wrappers for QObject::connect
methods. Unfortunately I wasn't able to reproduce the issue with Qt 5.6.2 on Linux, so I don't know why it's happening.
Can you pull the latest version and run the generator with --debug-logging=save
? The logs will be saved to log
subdirectory of the cache directory and should explain why the methods were skipped.
There is log
content for qt_core
: http://dump.lexs.blasux.ru/files/wunelid/log.7z
Revision 61740cfd34
rustc 1.19.0-dev (fa78d5bb8 2017-05-16)
cargo 0.20.0-dev (8e35fd7d 2017-05-16)
Thanks! I see that clang parser returns some strange results. I'll get clang 3.9 and 4.0 and look into the issue. Meanwhile, you can try to use clang 3.8 and see if it helps.
I've tried clang 3.8.1 on windows and get next error:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits:524:45: error: '_To' does not refer to a value
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits:524:50: error: '_From' does not refer to a value
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits:525:2: error: expected class name
Still I need -fms-compatibility-version=19
flag.
On linux there no stable clang 3.8 so it would be trouble to downgrade clang.
Little patch for cpp_to_rust/cpp_to_rust_generator/src/cpp_parser.rs
generates correct code for Linux.
TypeKind::Elaborated => {
let canonical = type1.get_canonical_type();
if canonical.get_kind() != TypeKind::Elaborated {
self.parse_type(canonical, context_class, context_method)
} else {
Err(format!("Elaborated type: {:?}. Canonical: {:?}", type1, canonical).into())
}
}
_ => Err(format!("Unsupported kind of type: {:?}. {:?}", type1.get_kind(), type1).into()),
On windows I get runtime error aboutn missing entry point for ?toLower@QByteArray@@QEGBA?AV1@XZ
in qt_core_c.dll
. Demangled name is
public: class QByteArray __cdecl QByteArray::toLower(void)const __ptr64&
Looks like it was caused by DLL hell so it should be fixed now.
I built
qt-generator
binary (I have to remove-fPIC
flag and add-fms-compatibility-version=19
to fix issue https://bugreports.qt.io/browse/QTCREATORBUG-15940 inexecutor.rs
) Then I generated core, gui, widgets and ui_tools libraries into project root and add them intoCargo.toml
as:When I start to build project I get next error:
Rust: rustc 1.17.0 (56124baa9 2017-04-24) (MSVC) Cargo: cargo 0.18.0 (fe7b0cdcf 2017-04-24) Clang: 4.0.0 Target: x86_64-pc-windows-msvc Qt: 5.6.2 MSVC: 2017
Generated files: https://gist.github.com/o01eg/f09189548669594c263ed1ee5b823d47
cpp_to_rust revision: 0d4cd5323156