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

Linking error on latest rust "error: linking with cc failed: exit code: 1" #85

Closed
mitchmindtree opened this issue May 10, 2015 · 4 comments

Comments

@mitchmindtree
Copy link
Member

Really not sure why this has appeared all of a sudden, but it's appearing on both travis and my local machine.

   Compiling portaudio v0.4.9 (file:///Users/Mitch/Programming/Rust/rust-portaudio)
error: linking with `cc` failed: exit code: 1
note: "cc" "-m64" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/examples/non_blocking" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/examples/non_blocking.o" "-Wl,-force_load,/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libmorestack.a" "-Wl,-dead_strip" "-nodefaultlibs" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/libportaudio.rlib" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/deps/libnum-b6664aad0573bf89.rlib" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/deps/librustc_serialize-9ef26f158d5284e0.rlib" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/deps/libbitflags-518ea12e21428edd.rlib" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/deps/librand-b924d9fc5b3eb5b8.rlib" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/deps/liblibc-674726c388d62fa2.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcollections-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librustc_unicode-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/librand-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liballoc-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-4e7c5e5c.rlib" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libcore-4e7c5e5c.rlib" "-L" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug" "-L" "/Users/Mitch/Programming/Rust/rust-portaudio/target/debug/deps" "-L" "/usr/local/lib" "-L" "/usr/local/lib" "-L" "/usr/local/lib/rustlib/x86_64-apple-darwin/lib" "-L" "/Users/Mitch/Programming/Rust/rust-portaudio/.rust/lib/x86_64-apple-darwin" "-L" "/Users/Mitch/Programming/Rust/rust-portaudio/lib/x86_64-apple-darwin" "-L" "/Users/Mitch/.rust/lib/x86_64-apple-darwin" "-lportaudio" "-lportaudio" "-framework" "CoreAudio" "-framework" "AudioToolbox" "-framework" "AudioUnit" "-framework" "Carbon" "-lc" "-lm" "-lSystem" "-lpthread" "-lc" "-lm" "-lcompiler-rt"
note: ld: warning: directory not found for option '-L/Users/Mitch/Programming/Rust/rust-portaudio/.rust/lib/x86_64-apple-darwin'
ld: warning: directory not found for option '-L/Users/Mitch/Programming/Rust/rust-portaudio/lib/x86_64-apple-darwin'
Undefined symbols for architecture x86_64:
  "_Pa_IsFormatSupported", referenced from:
      pa::is_format_supported::h1ef3fd3c748d2d7bwUc in libportaudio.rlib(portaudio.o)
  "_Pa_Terminate", referenced from:
      pa::terminate::h856c916ea7636e63ZTc in libportaudio.rlib(portaudio.o)
  "_Pa_GetVersionText", referenced from:
      pa::get_version_text::h1d9d5a55302362ecgTc in libportaudio.rlib(portaudio.o)
  "_Pa_GetDefaultInputDevice", referenced from:
      pa::device::get_default_input::h924f4c1b20bf1a283Qc in libportaudio.rlib(portaudio.o)
  "_Pa_GetHostApiInfo", referenced from:
      pa::host::get_api_info::h2fbcc6a5c8c1e723cSc in libportaudio.rlib(portaudio.o)
  "_Pa_GetDefaultOutputDevice", referenced from:
      pa::device::get_default_output::hed9ab2ede0d6545abRc in libportaudio.rlib(portaudio.o)
  "_Pa_StartStream", referenced from:
      pa::Stream$LT$I$C$$u20$O$GT$::start::h15868907980879137214 in non_blocking.o
  "_Pa_GetDeviceInfo", referenced from:
      pa::device::get_info::h769a764d65668102jRc in libportaudio.rlib(portaudio.o)
  "_Pa_IsStreamActive", referenced from:
      pa::Stream$LT$I$C$$u20$O$GT$::is_active::h16392955518606313780 in non_blocking.o
  "_Pa_Initialize", referenced from:
      pa::initialize::h3439edf44263d4b1GTc in libportaudio.rlib(portaudio.o)
  "_Pa_GetVersion", referenced from:
      pa::get_version::hd1aab81cb90c65618Sc in libportaudio.rlib(portaudio.o)
  "_Pa_GetDefaultHostApi", referenced from:
      pa::host::get_default_api::h27f764f218f6182e4Rc in libportaudio.rlib(portaudio.o)
  "_Pa_CloseStream", referenced from:
      pa::Stream$LT$I$C$$u20$O$GT$::close::h10379566129765308786 in non_blocking.o
  "_Pa_GetHostApiCount", referenced from:
      pa::host::get_api_count::ha9d2e7fee5b02461WRc in libportaudio.rlib(portaudio.o)
  "_Pa_OpenStream", referenced from:
      pa::Stream$LT$I$C$$u20$O$GT$::open::h2200290684482684206 in non_blocking.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
Could not compile `portaudio`.
@mitchmindtree
Copy link
Member Author

Might be related to this - investigating now.

@mitchmindtree
Copy link
Member Author

Only occurs when building the examples, the crate itself seems to build fine.

@mitchmindtree
Copy link
Member Author

Here are the error logs produced by travis.

@mitchmindtree
Copy link
Member Author

It seems this issue was introduced when cargo decided to remove the hash from the compiled libs, resulting in a conflict between the system libportaudio and the produced libportaudio.

I've posted an issue at the Cargo repo for discussion.

In the mean-time we can avoid this by either 1. renaming the crate or 2. not producing a dylib - I think we might as well wait to see the fait of the above issue as it would be nice to avoid both of these options :)

mitchmindtree added a commit that referenced this issue May 24, 2015
Don't build dylib to avoid run-time linking errors in examples (shown in #85).
veer66 added a commit to veer66/kyotocabinet-rs that referenced this issue Jun 2, 2016
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

1 participant