slint-ui / slint-rust-template

A template for a Rust Application using Slint. This is meant to be used with cargo-generate.
https://slint.rs
MIT License
199 stars 35 forks source link

I got an error when I initialized cargo build on macos 14.3 #15

Closed dannysun85 closed 7 months ago

dannysun85 commented 7 months ago

I initialized and created the program and running cargo build directly got the following error:

image

The final error will look like this:

image

I don't know where the problem is, I have searched many places but can't find the cause of the error.

tronical commented 7 months ago

Somehow you seem to have Qt installed on your Mac. What version of Slint are you using?

If you're looking for a workaround, I suggest to either remove qmake from your PATH or set SLINT_NO_QT=1.

dannysun85 commented 7 months ago

I really don't know why QTkit was installed, set SLINT_NO_QT=1 and everything worked fine. This problem has been bothering me for a long time, thank you so much it has been solved.

tronical commented 7 months ago

Would you still be able to paste us the output of which qmake and qmake -query? The SLINT_NO_QT=1 is just a workaround, we'd like to get to the root cause :)

dannysun85 commented 7 months ago

So far it looks like it's my anaconda3 installation. They will install qtkit automatically.

image image
tronical commented 7 months ago

Thank you for the info! That explains it. That might make it possible for us to reproduce it. Is this a bare-bones anaconda 3 install or did you install anything inside?

dannysun85 commented 7 months ago

Indeed, this problem is also something we all need to pay attention to. At present, the best solution is to automatically set the configuration file for the user when installing. anaconda3 is the installation package I downloaded from the official.dmg, and installed directly.

ogoffart commented 7 months ago

Similar as https://github.com/slint-ui/slint/issues/4560 Fixed by https://github.com/slint-ui/slint/pull/4566 which disable Qt on mac by default even if it is found.

dannysun85 commented 7 months ago

This is an exciting fix that helps us solve a lot of big problems!