rust-qt / ritual

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

Build error: undefined reference to symbol 'glGetShaderiv' #48

Closed Riateche closed 5 years ago

Riateche commented 7 years ago

From @o01eg on April 24, 2017 16:10

When I building test application I get link error:

error: linking with `x86_64-pc-linux-gnu-gcc` failed: exit code: 1
  |
  = note: "x86_64-pc-linux-gnu-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib" "/mnt/another/srcs/myHG/qt002/target/debug/deps/qt002-46ad6d4010520222.0.o" "-o" "/mnt/another/srcs/myHG/qt002/target/debug/deps/qt002-46ad6d4010520222" "-Wl,--gc-sections" "-pie" "-nodefaultlibs" "-L" "/mnt/another/srcs/myHG/qt002/target/debug/deps" "-L" "/mnt/another/srcs/myHG/qt002/target/debug/build/qt_gui-f784009b8344c408/out/c_lib/install/lib" "-L" "/usr/lib64" "-L" "/mnt/another/srcs/myHG/qt002/target/debug/build/qt_core-60553f7912947b5a/out/c_lib/install/lib" "-L" "/usr/lib64" "-L" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/mnt/another/srcs/myHG/qt002/target/debug/deps/libqt_gui-0d4794050bcbd5fd.rlib" "/mnt/another/srcs/myHG/qt002/target/debug/deps/libqt_core-e72c4c7f6eb15228.rlib" "/mnt/another/srcs/myHG/qt002/target/debug/deps/liblibc-40c5d4ad7fb59dec.rlib" "/mnt/another/srcs/myHG/qt002/target/debug/deps/libcpp_utils-68cd462a29803ccc.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/libstd-d20ce135c9335301.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-1a4ba5e8beac4036.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-cd26f559271bb98f.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/librand-3d8d915c03524d7b.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/libcollections-a7d339664f02e769.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-183f71f93a02fda2.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-f435e8d4a74b9cdb.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-880e63ad7955cdee.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/libstd_unicode-b5a39590f4af960b.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/libcore-b03b2a5c061a4a4c.rlib" "/usr/lib64/rust-9999/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-47c52e4884184cf0.rlib" "-Wl,-Bdynamic" "-l" "Qt5Gui" "-l" "stdc++" "-l" "Qt5Core" "-l" "stdc++" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "pthread" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util"
  = note: /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/../../../../x86_64-pc-linux-gnu/bin/ld: /mnt/another/srcs/myHG/qt002/target/debug/deps/libqt_gui-0d4794050bcbd5fd.rlib(qt_gui_c_QOpenGLExtraFunctions.cpp.o): undefined reference to symbol 'glGetShaderiv'
          /usr/lib64/opengl/nvidia/lib/libGLESv2.so.2: error adding symbols: DSO missing from command line
          collect2: error: ld returned 1 exit status

If I add RUSTFLAGS="-l GL" it builds but I suppose it should add this flag from configuration step.

_Copied from original issue: rust-qt/qtgui#1

Riateche commented 5 years ago

This shouldn't happen anymore. Please report if this happens with the current version.