Closed Tolsi closed 5 years ago
Thanks for the report. The build script couldn't detect that the Qt build contains frameworks, so it tried to link against libraries and failed. The fix is published in qt_ritual_common v0.1.1
.
Great, thanks! It problem was solved, but I still can't build this repo:
Compiling rust_qt_examples v0.0.0 (/Users/tolsi/Documents/examples)
error: linking with `cc` failed: exit code: 1
|
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-m64" "-L" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.16w4ktdvp0fs9rmf.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.1ftaukfz5lkhfih3.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.29bqzak2lnz7f7tw.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.2b8g4udtbjydv9jh.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.2vu6rccpg6ps8457.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.3j1k8wssmsujwttp.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.3sgc0da3om1j225k.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.3udcr1vfp94rw88q.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.40rrr1tf0wnokt6n.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.43il3dwkrjyoe8y1.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.47o0vxa4ca5omkxe.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.4bik94s8y04l8py5.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.4z47xy7ej4svwom6.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.58ble9l59mb5b91.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.61to8be4t4lkddr.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.696nadra1h2bmet.rcgu.o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.71sqob80w41x5wz.rcgu.o" "-o" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3" "/Users/tolsi/Documents/examples/target/debug/deps/hello_world-e426124dba4107a3.167aow6wguvg4d9j.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/tolsi/Documents/examples/target/debug/deps" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_3d_core-a972bcdf33087f6f/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_core-8ddce45c1c50c21e/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_gui-825bd49affb478f2/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_3d_extras-cbc25b1492a2b30d/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_3d_input-16d970d8b24edec5/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_3d_logic-67e6ce62fe335537/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_3d_render-2fac7e22f542ce9c/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_charts-5be57bf5304beaf9/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_widgets-3b37decd28a718ef/out/c_lib_install" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_qml-50b2f1646299d1fe/out/c_lib_install" "-L" "/usr/local/Cellar/qt/5.13.1/lib" "-F" "/usr/local/Cellar/qt/5.13.1/lib" "-L" "/Users/tolsi/Documents/examples/target/debug/build/qt_ui_tools-0628c76e4e61eae4/out/c_lib_install" "-L" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/tolsi/Documents/examples/target/debug/deps/libqt_core-cdd95c30e5d95242.rlib" "/Users/tolsi/Documents/examples/target/debug/deps/libcpp_utils-c1eb3f6ffbefaf2f.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-f5ac182b2a26610e.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-dfb94dde79e9ab53.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libbacktrace_sys-0005b96c44721c74.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-b8a7b4974c01cbf3.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-186b2febaded39c9.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-afe0dcae896b226b.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-55cfc224553c5fd4.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-7ccc9d31fb24c92b.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-fed8bcabaae28c30.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-36c8bf2cb6e140ce.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-024113f4cac0a15f.rlib" "/Users/tolsi/.rustup/toolchains/1.36.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-1be0692ae6dec4e9.rlib" "-lstdc++" "-framework" "QtCore" "-lSystem" "-lresolv" "-lc" "-lm"
= note: ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
...
How can I install stdc++ on mac os x? It looks like it was deprecated. There are some stuff like this:
> find /usr -name 'libstdc++*'
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/libstdc++.6.dylib
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/libstdc++.a-gdb.py
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/libstdc++fs.a
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/libstdc++.a
/usr/local/Cellar/gcc/9.2.0/lib/gcc/9/libstdc++.dylib
/usr/lib/libstdc++.6.dylib
/usr/lib/libstdc++.6.0.9.dylib
/usr/lib/libstdc++.dylib
Looks like we should use libc++
on MacOS instead. I can't reproduce this issue on my system, unfortunately. I've pushed the patched version to the use-libcpp-on-macos branch of examples repo. Can you check if it works for you?
Yes, sure
ср, 11 сент. 2019 г., 19:43 Pavel Strakhov notifications@github.com:
Looks like we should use libc++ on MacOS instead. I can't reproduce this issue on my system, unfortunately. I've pushed the patched version to the use-libcpp-on-macos https://github.com/rust-qt/examples/tree/use-libcpp-on-macos branch of examples repo. Can you check if it works for you?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rust-qt/examples/issues/1?email_source=notifications&email_token=AALRJSSEYK23AVZ77D3C3ADQJEN4DA5CNFSM4IVBDJ42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6PD7SA#issuecomment-530464712, or mute the thread https://github.com/notifications/unsubscribe-auth/AALRJSQFGNJ4IZWN5P7WKH3QJEN4DANCNFSM4IVBDJ4Q .
I checked it and got an interesting result - I have two laptops on mac os, the old version from master immediately worked on the old one, and in the second I got the error described above. The version from the branch works on both devices. Now I am ready to make a small application with an interface using your library! Thank you for creating this library and quick support.
The fix is published in ritual_build 0.1.1
.
qt was installed using brew
How can I pass LDFLAGS and CPPFLAGS to the CC? I already tried
rustflags = ["-C", "link-args=-L/usr/local/opt/qt/lib"]
in build.rs, just env variables... same error.