rust-qt / ritual

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

Runtime error with a simple application. #62

Closed o01eg closed 6 years ago

o01eg commented 6 years ago

rust 1.21.0 x64 msvc MS VS 2017 Qt 5.9.2 clang 5.0.0

main.rs:

extern crate qt_core;
extern crate qt_gui;
extern crate qt_widgets;
extern crate qt_ui_tools;

use qt_widgets::application::Application;

fn main() {
    Application::create_and_exit(|app| {
        println!("Hello, Qt!");
        let r = Application::exec();
        println!("Bye, Qt!");
        r
    });
}

I get runtime error: qt

Entry point for procedure ?inputMethodQuery@QComboBox@@QEBA?AVQVariant@@W4InputMethodQuery@Qt@@AEBV2@@Z not found in Qt5Widgest.dll library.

Unmangled name is

public: class QVariant __cdecl QComboBox::inputMethodQuery(enum Qt::Input
MethodQuery,class QVariant const & __ptr64)const __ptr64
Riateche commented 6 years ago

I think this error means that the Qt libraries available at runtime are not the same as libraries used for building the crates (otherwise the error would happen when building). Is the folder containing Qt DLLs aded to PATH?

o01eg commented 6 years ago

I suppose it loads Qt5Widgets from cmake which also added to PATH. I'll trying to reinstall cmake without GUI.

o01eg commented 6 years ago

Yep, it works without cmake in PATH but looks like cmake installs only with GUI and Qt libraries in bin.

o01eg commented 6 years ago

No, i was something other but it fixed by copiyng Qt libraries to project folder.