brson / rust-sdl

SDL bindings for Rust
MIT License
179 stars 52 forks source link

Linking issues with rustpkg and OSX #52

Closed Qard closed 9 years ago

Qard commented 11 years ago

Hey, so rust-sdl isn't compiling with rustpkg on OSX. It builds fine using the Makefile. But with rustpkg I'm getting some linking issues.

error: linking with `cc` failed with code 1
note: cc arguments: -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -m64 -o /Users/stephenbelanger/.rustpkg/work/sdl-7f49efacedcf6bba-0.3.0/lib/libsdl-34b7eedb9132850-0.3.0.dylib /Users/stephenbelanger/.rustpkg/work/sdl-7f49efacedcf6bba-0.3.0/lib/sdl.o -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lcore-c3ca5d77d81b46c1-0.6 -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lstd-4782a756585a81-0.6 -L. -lSDLXmain -framework AppKit -framework Foundation -dynamiclib -Wl,-install_name,@rpath/libsdl-34b7eedb9132850-0.3.0.dylib -Wl,-no_compact_unwind -lmorestack -lrustrt -Wl,-rpath,@executable_path/../../../../../../usr/local/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/usr/local/Cellar/rust/0.6/lib/rustc/x86_64-apple-darwin/lib

When I run sdl-config --libs I get -L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa. It seems to coincide with the $(SDLXMAIN) block in the Makefile. I'm not sure how to replicate that in pkg.rs though.

AngryLawyer commented 11 years ago

I'll see what I can do about this.