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

error : note: ld: library not found for -lncursesw #89

Closed
adals opened this issue Nov 30, 2016 · 17 comments
Closed

error : note: ld: library not found for -lncursesw #89

adals opened this issue Nov 30, 2016 · 17 comments

Comments

@adals
Copy link

adals commented Nov 30, 2016

hello

i am on macos how to install that library to my system

$ brew install ncurses
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
skinny

Warning: homebrew/dupes/ncurses-6.0_2 already installed

@gyscos
Copy link
Owner

gyscos commented Nov 30, 2016

Is there a ncursesw package in homebrew?

@gyscos
Copy link
Owner

gyscos commented Nov 30, 2016

Maybe related:
http://stackoverflow.com/questions/32955658/what-is-the-correct-way-to-use-wide-char-ncurses-on-debian-ubuntu

Looks like supporting macos might be a bit more complicated : /

@gyscos
Copy link
Owner

gyscos commented Dec 10, 2016

I tried a target-specific Cargo.toml in the macos branch, can you have a try at it and see if it makes things better? Thanks!

@gyscos
Copy link
Owner

gyscos commented Dec 12, 2016

You can specify the dependency in Cargo.toml:

[dependencies.cursive]
git = "https://github.com/gyscos/Cursive"
branch = "macos"

@mmiecz
Copy link

mmiecz commented Dec 15, 2016

Hi there. I've had the same issue with ncursesw lib, and macos branch didn't solve the problem, unfortunately.
However, I've switched to termion backend, and everything seems to be working fine.

@gyscos
Copy link
Owner

gyscos commented Dec 16, 2016

Looks like the reason the macos branch still fails is rust-lang/cargo#1197
:(

@AdamKyle
Copy link

This actually worked for me. I was having the WORST time trying to fix this. But this compiled and so far seems to work.

@gyscos
Copy link
Owner

gyscos commented Dec 20, 2016

Some newer versions of cargo may have a better dependency resolving system? @mmiecz , could you try upgrading cargo and see if it changes anything?

@mmiecz
Copy link

mmiecz commented Dec 21, 2016

Hi, I've updated cargo, and everything seems to be working fine now. Thanks!

@mmiecz
Copy link

mmiecz commented Dec 21, 2016

Actually, I've run into some really weird problem. Whenever I try to compile example code without any changes, Cursive gets recompiled every time. Sometimes it gets recompiled without any error, and sometimes old error comes back:

MacBook-Air-Micha:terminal-tests mhl$ cargo run
   Compiling cursive v0.3.5 (https://github.com/gyscos/Cursive?branch=macos#451d0522)
   Compiling terminal-tests v0.1.0 (file:///Users/mhl/Sources/terminal-tests)
    Finished debug [unoptimized + debuginfo] target(s) in 5.45 secs
     Running `target/debug/terminal-tests`
MacBook-Air-Micha:terminal-tests mhl$ cargo run
   Compiling cursive v0.3.5 (https://github.com/gyscos/Cursive?branch=macos#451d0522)
   Compiling terminal-tests v0.1.0 (file:///Users/mhl/Sources/terminal-tests)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/terminal_tests-d163a702128509ba.0.o" "-o" "/Users/mhl/Sources/terminal-tests/target/debug/deps/terminal_tests-d163a702128509ba" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/mhl/Sources/terminal-tests/target/debug/deps" "-L" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libcursive-589ffaec46642e7b.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libunicode_segmentation-1400e9f38485b222.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libncurses-64b8ed169553261c.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libtoml-5130c1b472bb88f9.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libunicode_width-a8b627b65c290dac.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/liblibc-73c6422e7b19c2f3.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/librustc_serialize-03b62901d97343ea.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libodds-798c90752ba21e6f.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-713ad88203512705.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-8db31eff4f3f5d1c.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-9d903f075d9d1ed3.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librand-15da1025aec585ac.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcollections-eba7f19f0aae5f37.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-0fa051c7d0594505.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-9dddbb08233542f3.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-72ccf8e77ba91924.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-d3fcdc16d2a25b3a.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-407db9a296a50c43.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-dfc954c33c85abed.rlib" "-l" "ncursesw" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m"
  = note: ld: library not found for -lncursesw
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This looks like cargo error.

@gyscos
Copy link
Owner

gyscos commented Dec 21, 2016

That's weird indeed. Maybe the cargo cache got messed up with an upgrade? cargo clean could help?

@mmiecz
Copy link

mmiecz commented Dec 21, 2016

I've done cargo update and cargo clean and I still have this:

MacBook-Air-Micha:terminal-tests mhl$ cargo clean
MacBook-Air-Micha:terminal-tests mhl$ cargo build
   Compiling rustc-serialize v0.3.22
   Compiling odds v0.2.25
   Compiling unicode-segmentation v0.1.3
   Compiling cursive v0.3.5 (https://github.com/gyscos/Cursive?branch=macos#451d0522)
   Compiling unicode-width v0.1.3
   Compiling libc v0.2.18
   Compiling ncurses v5.84.0
   Compiling toml v0.2.1
   Compiling terminal-tests v0.1.0 (file:///Users/mhl/Sources/terminal-tests)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/terminal_tests-d163a702128509ba.0.o" "-o" "/Users/mhl/Sources/terminal-tests/target/debug/deps/terminal_tests-d163a702128509ba" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/mhl/Sources/terminal-tests/target/debug/deps" "-L" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libcursive-589ffaec46642e7b.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libunicode_segmentation-1400e9f38485b222.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libncurses-64b8ed169553261c.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libtoml-5130c1b472bb88f9.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libunicode_width-a8b627b65c290dac.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/liblibc-73c6422e7b19c2f3.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/librustc_serialize-03b62901d97343ea.rlib" "/Users/mhl/Sources/terminal-tests/target/debug/deps/libodds-798c90752ba21e6f.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-713ad88203512705.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-8db31eff4f3f5d1c.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-9d903f075d9d1ed3.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librand-15da1025aec585ac.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcollections-eba7f19f0aae5f37.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-0fa051c7d0594505.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-9dddbb08233542f3.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-72ccf8e77ba91924.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_unicode-d3fcdc16d2a25b3a.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-407db9a296a50c43.rlib" "/Users/mhl/.rustup/toolchains/nightly-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-dfc954c33c85abed.rlib" "-l" "ncursesw" "-l" "System" "-l" "pthread" "-l" "c" "-l" "m"
  = note: ld: library not found for -lncursesw
clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: Could not compile `terminal-tests`.

To learn more, run the command again with --verbose.
MacBook-Air-Micha:terminal-tests mhl$ cargo build
   Compiling ncurses v5.84.0
   Compiling cursive v0.3.5 (https://github.com/gyscos/Cursive?branch=macos#451d0522)
   Compiling terminal-tests v0.1.0 (file:///Users/mhl/Sources/terminal-tests)
    Finished debug [unoptimized + debuginfo] target(s) in 6.47 secs
MacBook-Air-Micha:terminal-tests mhl$ 

@gyscos
Copy link
Owner

gyscos commented Dec 21, 2016

Doh. Looks like cargo is not quite stable just yet.

@gyscos
Copy link
Owner

gyscos commented Jan 6, 2017

Hopefully jeaye/ncurses-rs#123 will make this easier.

@gyscos
Copy link
Owner

gyscos commented Jan 7, 2017

You can try the latest master branch, it should fix this problem in a more stable way.

@mmiecz
Copy link

mmiecz commented Jan 13, 2017

Yes, everything now is OK.

@gyscos
Copy link
Owner

gyscos commented Jan 14, 2017

Great! :D

@gyscos gyscos closed this as completed Jan 14, 2017
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