ncurses-rs icon indicating copy to clipboard operation
ncurses-rs copied to clipboard

Build error on OSX 10.9.1

Open sssilver opened this issue 11 years ago • 2 comments

ProductName: Mac OS X ProductVersion: 10.9.1 BuildVersion: 13B3116

silver@calypso:~/Projects/Rust/ncurses-rs-master% sudo make -B   
»»» Building ncurses-rs 
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-o' 'lib/libncurses-f5aa8b14-5.71.dylib' 'lib/ncurses.o' 'lib/ncurses.metadata.o' '-L/Users/silver/Projects/Rust/ncurses-rs-master/.rust' '-L/Users/silver/Projects/Rust/ncurses-rs-master' '-L/Users/silver/Projects/Rust/.rust' '-lncurses' '-L/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lstd-3e5aeb83-0.9' '-lpthread' '-dynamiclib' '-Wl,-dylib' '-Wl,-install_name,@rpath/libncurses-f5aa8b14-5.71.dylib' '-lmorestack' '-Wl,-rpath,@loader_path/../../../../../../usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/Cellar/rust/0.9/lib/rustlib/x86_64-apple-darwin/lib'
note: ld: warning: directory not found for option '-L/Users/silver/Projects/Rust/ncurses-rs-master/.rust'
Undefined symbols for architecture x86_64:
  "_has_mouse", referenced from:
      has_mouse::h1ead82b7e4510befaN::v5.71 in ncurses.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error
task 'rustc' failed at 'explicit failure', /private/tmp/rust-R5p2/rust-0.9/src/libsyntax/diagnostic.rs:75
task '<main>' failed at 'explicit failure', /private/tmp/rust-R5p2/rust-0.9/src/librustc/lib.rs:453
make: *** [.build_lib] Error 101

sssilver avatar Feb 26 '14 03:02 sssilver

From Go ncurses binding

has_mouse() undeclared - Goncurses is currently being tested against ncurses 5.9. As of this writing, OSX ships with ncurses 5.7 installed. Since this function was added in 5.8 it is recommended that you upgrade your version of ncurses in order to use Goncurses. There has been a recent fix pushed to tip that should prevent this error from happening however it is still recommended that you upgrade to ncurses 5.9. It has been reported that MacPorts provides a working install of ncurses 5.9. If you choose to use homebrew to install a newer version of ncurses, cgo may still try to link against the older version depending on where and how homebrew installed ncurses. There are several solutions to overcoming this dilemma but it is up to the user to determine the best solution for their situation.

As a temporary fix, I've commented out has_mouse function (locally) and the examples work fine.

diff --git a/src/lib.rs b/src/lib.rs
index 2056e72..5a01e85 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1973,8 +1973,8 @@ pub fn KEY_F(n: u8) -> i32
  * Added mouse support
  */

-pub fn has_mouse() -> i32
-{ unsafe { ll::has_mouse() } }
+// pub fn has_mouse() -> i32
+// { unsafe { ll::has_mouse() } }

 pub fn getmouse(event: *MEVENT) -> i32
 { unsafe { ll::getmouse(event) } }

utkarshkukreti avatar Apr 21 '14 07:04 utkarshkukreti

Let's just fail with an unsupported message on OS X? This is unfortunate.

jeaye avatar Apr 21 '14 17:04 jeaye