Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt linking to icu: confusion between system-wide installed one and Qt provided one #4

Open
nbigaouette opened this issue Jul 9, 2016 · 3 comments

Comments

@nbigaouette
Copy link
Owner

Arch Linux provides Qt 5.7 and icu, installed system-wide:

$ ldd /usr/lib/libQt5Core.so.5.7.0
    [...]
    libicui18n.so.57 => /usr/lib/libicui18n.so.57 (0x00007ff249892000)
    libicuuc.so.57 => /usr/lib/libicuuc.so.57 (0x00007ff2494ea000)
    libicudata.so.57 => /usr/lib/libicudata.so.57 (0x00007ff2464a8000)
    [...]
$ pacman -Qo /usr/lib/libQt5Core.so.5.7.0
/usr/lib/libQt5Core.so.5.7.0 is owned by qt5-base 5.7.0-1
$ pacman -Qo /usr/lib/libicuuc.so.57
/usr/lib/libicuuc.so.57 is owned by icu 57.1-1

Installing Qt from the installer (qt-unified-linux-x64-2.0.3-1-online.run) will also install its own version:

ldd ~/Qt/5.7/gcc_64/lib/libQt5Core.so.5.7.0
    [...]
    libicui18n.so.56 => ${HOME}/Qt/5.7/gcc_64/lib/libicui18n.so.56 (0x00007f53cb34c000)
    libicuuc.so.56 => ${HOME}/Qt/5.7/gcc_64/lib/libicuuc.so.56 (0x00007f53caf94000)
    libicudata.so.56 => ${HOME}/Qt/5.7/gcc_64/lib/libicudata.so.56 (0x00007f53c95b1000)
    [...]

But compiling using Qt from the installer (QT_DIR=${HOME}/Qt/5.7/gcc_64) fails to link:

cargo build --verbose --example hello_world
       Fresh libc v0.2.13
   Compiling libqmlbind-sys v0.0.2 (file://${HOME}/qmlrsng.git/libqmlbind-sys)
     Running `rustc examples/hello_world.rs --crate-name hello_world --crate-type bin -g --out-dir ${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/examples --emit=dep-info,link -L dependency=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug -L dependency=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/deps --extern libc=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/deps/liblibc-30d46fdd62f8c2eb.rlib --extern libqmlbind_sys=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/liblibqmlbind_sys.rlib -L libqmlbind/qmlbind -L ${HOME}/Qt/5.7/gcc_64/lib`
examples/hello_world.rs:33:13: 33:22 warning: unused variable: `exit_code`, #[warn(unused_variables)] on by default
examples/hello_world.rs:33         let exit_code = ffi::qmlbind_application_exec(app);
                                       ^~~~~~~~~
examples/hello_world.rs:26:13: 26:24 warning: variable `errorString` should have a snake case name such as `error_string`, #[warn(non_snake_case)] on by default
examples/hello_world.rs:26         let errorString = ffi::qmlbind_component_get_error_string(component);
                                       ^~~~~~~~~~~
error: linking with `cc` failed: exit code: 1
note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/examples/hello_world.0.o" "-o" "${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/examples/hello_world" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "${HOME}/qmlrsng.git/libqmlbind-sys/target/debug" "-L" "${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/deps" "-L" "libqmlbind/qmlbind" "-L" "${HOME}/Qt/5.7/gcc_64/lib" "-L" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "-Wl,-Bdynamic" "${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/liblibqmlbind_sys.rlib" "${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/deps/liblibc-30d46fdd62f8c2eb.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_unicode-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librand-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-e8edd0fd.rlib" "${HOME}/.multirust/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-e8edd0fd.rlib" "-l" "Qt5Core" "-l" "Qt5Network" "-l" "Qt5Gui" "-l" "Qt5Qml" "-l" "Qt5Widgets" "-l" "icui18n" "-l" "icuuc" "-l" "icudata" "-l" "stdc++" "-l" "util" "-l" "dl" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "util" "-l" "compiler-rt"
note: /usr/bin/ld: warning: libicui18n.so.56, needed by ${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicuuc.so.56, needed by ${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libicudata.so.56, needed by ${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `u_strToLower_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getStandardName_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getAlias_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `uenum_next_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `u_strToUpper_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_setSubstChars_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_getTimeZoneDisplayName_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_fromUnicode_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `u_errorName_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `uenum_close_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_getDSTSavings_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_openTimeZoneIDEnumeration_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_setMillis_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_close_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_getSortKey_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_get_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_open_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_compareNames_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_clone_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_open_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_setAttribute_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_openCountryTimeZones_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_open_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_openTimeZones_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_countAliases_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_inDaylightTime_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_close_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getAvailableName_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getDefaultName_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucal_getDefaultTimeZone_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_toUnicode_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucol_strcoll_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_close_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_getMaxCharSize_56'
${HOME}/Qt/5.7/gcc_64/lib/libQt5Core.so: undefined reference to `ucnv_countAvailable_56'
collect2: error: ld returned 1 exit status

error: aborting due to previous error
error: Could not compile `libqmlbind-sys`.

Caused by:
  Process didn't exit successfully: `rustc examples/hello_world.rs --crate-name hello_world --crate-type bin -g --out-dir ${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/examples --emit=dep-info,link -L dependency=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug -L dependency=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/deps --extern libc=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/deps/liblibc-30d46fdd62f8c2eb.rlib --extern libqmlbind_sys=${HOME}/qmlrsng.git/libqmlbind-sys/target/debug/liblibqmlbind_sys.rlib -L libqmlbind/qmlbind -L ${HOME}/Qt/5.7/gcc_64/lib` (exit code: 101)

It seems cargo is trying to link to the system wide icu instead of the one provided by the installer.

@danielng01
Copy link

Hi,
I get this error when I was trying to build Iris under Ubuntu.
I solved it by removing
CONFIG += static
from the .pro file

@nbigaouette
Copy link
Owner Author

So Iris is a library that was built statically? I'd have to check back but I think icu is linked dynamically here...

@danielng01
Copy link

No, it's my application
The problem was
CONFIG += static
in the Pro file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants