cyndis / qmlrs

QtQuick interface for Rust
Apache License 2.0
436 stars 43 forks source link

install problem on ubuntu #15

Closed Arnold1 closed 9 years ago

Arnold1 commented 9 years ago

hi,

i use ubuntu with rustc 1.2.0-nightly (764877650 2015-06-12) and qt: http://download.qt.io/official_releases/qt/5.4/5.4.2/qt-opensource-linux-x64-5.4.2.run any idea what is missing causing the build to fail?

$ cargo build
...
Compiling qmlrs v0.0.1 (file:///home/arnold/qmlrs)
failed to run custom build command for `qmlrs v0.0.1 (file:///home/arnold/qmlrs)`
Process didn't exit successfully: `/home/arnold/qmlrs/target/debug/build/qmlrs-0a6bb7a1b746b935/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-lib=static=qmlrswrapper
cargo:rustc-link-lib=dylib=stdc++
cargo:rustc-link-search=native=/home/arnold/qmlrs/ext/libqmlrswrapper/build

--- stderr
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"Qt5Core Qt5Gui Qt5Qml Qt5Quick\"` did not exit successfully: exit code: 1\n--- stderr\nPackage Qt5Core was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Core.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Core\' found\nPackage Qt5Gui was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Gui.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Gui\' found\nPackage Qt5Qml was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Qml.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Qml\' found\nPackage Qt5Quick was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Quick.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Quick\' found\n"', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libcore/result.rs:731
Arnold1 commented 9 years ago

i set the following env variable:

export PKG_CONFIG_PATH=/home/Arnold/Qt5.4.2/5.4/gcc_64/lib/pkgconfig

after that i get this error:

src/lib.rs:59:1: 59:10 error: The attribute `packed` is currently unknown to the compiler and may have meaning added to it in the future
src/lib.rs:59 #[packed]
              ^~~~~~~~~
src/lib.rs:59:1: 59:10 help: add #![feature(custom_attribute)] to the crate attributes to enable
error: aborting due to previous error
Could not compile `qmlrs`.
Arnold1 commented 9 years ago

than i added the following at the top of src/lib.rs:

#![feature(custom_attribute)]

this results in the following error, any idea how to fix it?

s$ cargo build --verbose
       Fresh libc v0.1.8
       Fresh pkg-config v0.3.4 (https://github.com/alexcrichton/pkg-config-rs#9c3ba519)
   Compiling qmlrs v0.0.1 (file:///home/Arnold/qmlrs)
     Running `/home/Arnold/qmlrs/target/debug/build/qmlrs-0a6bb7a1b746b935/build-script-build`
     Running `rustc src/lib.rs --crate-name qmlrs --crate-type lib -g --out-dir /home/Arnold/qmlrs/target/debug --emit=dep-info,link -L dependency=/home/Arnold/qmlrs/target/debug -L dependency=/home/Arnold/qmlrs/target/debug/deps --extern libc=/home/Arnold/qmlrs/target/debug/deps/liblibc-ef5cbad4ef5c7a1e.rlib -L native=/home/Arnold/qmlrs/ext/libqmlrswrapper/build -L native=/home/Arnold/Qt5.4.2/5.4/gcc_64/lib -l static=qmlrswrapper -l dylib=stdc++ -l Qt5Quick -l Qt5Gui -l Qt5Qml -l Qt5Network -l Qt5Core`
src/lib.rs:61:1: 61:10 warning: unused attribute, #[warn(unused_attributes)] on by default
src/lib.rs:61 #[packed]
              ^~~~~~~~~
error: could not find native static library `qmlrswrapper`, perhaps an -L flag is missing?
Could not compile `qmlrs`.

Caused by:
  Process didn't exit successfully: `rustc src/lib.rs --crate-name qmlrs --crate-type lib -g --out-dir /home/Arnold/qmlrs/target/debug --emit=dep-info,link -L dependency=/home/Arnold/qmlrs/target/debug -L dependency=/home/Arnold/qmlrs/target/debug/deps --extern libc=/home/Arnold/qmlrs/target/debug/deps/liblibc-ef5cbad4ef5c7a1e.rlib -L native=/home/Arnold/qmlrs/ext/libqmlrswrapper/build -L native=/home/Arnold/Qt5.4.2/5.4/gcc_64/lib -l static=qmlrswrapper -l dylib=stdc++ -l Qt5Quick -l Qt5Gui -l Qt5Qml -l Qt5Network -l Qt5Core` (exit code: 101)
liamsi commented 9 years ago

Make sure you've installed all relevant Qt packages (I do not use ubuntu, but you should be able to compile other Qt/QML projects examples from source). And if you use Rust stable, you do not need "#![feature(custom_attribute)]".

I think this issue is safe to be closed.

Cheers, Ismail

Arnold1 commented 9 years ago

i installed: http://download.qt.io/official_releases/qt/5.4/5.4.2/qt-opensource-linux-x64-5.4.2.run this also includes qml... any idea?

liamsi commented 9 years ago

Nope no idea. And this problem is not related to this project at all, but on howto install packages on ubuntu. Ask someone on the ubuntu forums etc. They have a wonderful and helpful community.

cc: @cyndis Please close this issue.

Cheers, Ismail

Arnold1 commented 9 years ago

what package is missing to be installed? this is not clear from the compile error...

liamsi commented 9 years ago

You are funny, I can only repeat myself: "this problem is not related to this project at all, but on howto install packages on ubuntu. Ask someone on the ubuntu forums etc. " Obviously, you won't get any help here.

Have a look here for instance https://askubuntu.com/ and consult you favorite search engine before.

Arnold1 commented 9 years ago

i dont talk to you funny monkey! if you are not able to give useful error messages than its related to your project.

liamsi commented 9 years ago

Are you talking to me? ;-)

Nope, it is not the task of a compiler to tell you which ubuntu packages you need to install. You could easily search for that yourself. And after that, you could help others and contribute to this project by adding it to the documentation.

Besides that: Your last two error messages aren't even related to missing packages. But as I've already told you they are related to using rust nightly. If you use Rust stable they'll disappear.

Sorry, for the harsh tone and good luck to you (probably on askubuntu.com) and besides that: it is not my project, I was just trying to help

Arnold1 commented 9 years ago

fixed, here the solution: 1.) download and install qt from here: http://download.qt.io/official_releases/qt/5.4/5.4.2/qt-opensource-linux-x64-5.4.2.run 2.) set CMAKE_PREFIX_PATH to make cmake happy $ export CMAKE_PREFIX_PATH=/home/Arnold/Qt5.4.2/5.4/gcc_64 3.) install opengl $ sudo apt-get install libglu1-mesa-dev 4.) set LD_LIBRARY_PATH so that it finds libicui18n.so.53 and stuff $ export LD_LIBRARY_PATH=/home/Arnold/Qt5.4.2/5.4/gcc_64/lib/

can you add those to the doc? with friendly greets from Arnold!?

kvey commented 8 years ago

Had the same issue, same resolution with minor changes for local environment and qt version. I agree this should be part of the documentation. This issue is related to this project as it has to do with dependency installation. The associated environment variable changes are not part of standard ubuntu package installation, and the project error message is quasi-tangential to this solution.

Note: If Qt is installed from source rather than using the installer like this the solution is probably different as well.

ciofeca commented 7 years ago

On Ubuntu 16.04 with stock Qt5 install, you only need to install a few non-default packages:

sudo apt install qt5-qmake qtdeclarative5-dev qtquick1-5-dev qml-module-qtquick-controls

rnestler commented 6 years ago

On Ubuntu 16.04 with stock Qt5 install, you only need to install a few non-default packages: sudo apt install qt5-qmake qtdeclarative5-dev qtquick1-5-dev qml-module-qtquick-controls

It would be nice to add this to the README, so people can get started quickly.