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

undefined reference to `COLORS' #191

Open
aplanas opened this issue Dec 12, 2019 · 3 comments
Open

undefined reference to `COLORS' #191

aplanas opened this issue Dec 12, 2019 · 3 comments

Comments

@aplanas
Copy link

aplanas commented Dec 12, 2019

When compiling ncspot from git, I have this linker error at the end:

...
pe" "-lxcb-xfixes" "-lncursesw" "-ltinfo" "-lutil" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/lib64/gcc/x86_64-suse-linux/9/../../../../x86_64-suse-linux/bin/ld: /home/aplanas/ncspot/target/release/deps/libncurses-9568030c4c279be4.rlib(ncurses-9568030c4c279be4.ncurses.6tisobd3-cgu.4.rcgu.o): in function `ncurses::constants::COLORS':
          ncurses.6tisobd3-cgu.4:(.text._ZN7ncurses9constants6COLORS17h28f96c61a3832871E+0x3): undefined reference to `COLORS'
          collect2: error: ld returned 1 exit status

I have openSUSE Tumbleweed:

> rpm -qa | grep ncurses
ncurses-devel-6.1-24.1.x86_64
ncurses-utils-6.1-24.1.x86_64
libncurses6-6.1-24.1.x86_64

> rpm -qa | grep terminfo
terminfo-screen-6.1-24.1.x86_64
terminfo-6.1-24.1.x86_64
terminfo-base-6.1-24.1.x86_64
@FliegendeWurst
Copy link

Workaround: install libncurses5 and add #[link(name = "ncursesw")] to the extern block in src/ll.rs (done in my fork).
Building then requires these env variables:

NCURSES_RS_RUSTC_LINK_LIB=ncursesw::libncursesw.so.5
NCURSES_RS_RUSTC_FLAGS="-L /lib64"

@ptesarik
Copy link

I'm not sure the workaround is correct. For me, it failed to link because of conflicts in libtinfo, but I could get a working executable after installing ncurses5-devel and with the following env variable:

export NCURSES_RS_RUSTC_FLAGS="-L /usr/lib64/ncurses5"

@eganonoa
Copy link

eganonoa commented Jan 1, 2021

I'm not sure the workaround is correct. For me, it failed to link because of conflicts in libtinfo, but I could get a working executable after installing ncurses5-devel and with the following env variable:

export NCURSES_RS_RUSTC_FLAGS="-L /usr/lib64/ncurses5"

Thank you!!! This was killing me. I can confirm this worked and fixed the problem I was having building ncspot on OpenSuse Leap 15.2. Because the snap version gives no sound on OpenSuse Leap, this fix was required to get ncspot working.

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

No branches or pull requests

4 participants