brson / rust-sdl

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

OSX linking error when making demo: "Undefined symbol __SDL_main " #96

Closed jsanders closed 10 years ago

jsanders commented 11 years ago
$ make demos
rustc -L . demo/demo.rc -o demos
demo/video.rs:3:4: 3:11 warning: unused import [-W unused-imports (default)]
demo/video.rs:3 use std::rt;
                    ^~~~~~~
error: linking with `cc` failed with code 1
note: cc arguments: -L/usr/local/rust-master/lib/rustc/x86_64-apple-darwin/lib -m64 -o demos demos.o -L/usr/local/rust-master/lib/rustc/x86_64-apple-darwin/lib -lstd-6c65cf4b443341b1-0.8-pre -L. -lsdl-95460b1b072257-0.3.0 -lSDL_image -lSDL_mixer -lSDL -lSDLmain -framework Foundation -framework AppKit -L. -L/Users/james/Code/rust-sdl/.rust -L/Users/james/Code/rust-sdl -Wl,-no_compact_unwind -lmorestack -lrustrt -Wl,-rpath,@executable_path/../../../../usr/local/rust-master/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,@executable_path/. -Wl,-rpath,/usr/local/rust-master/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/Users/james/Code/rust-sdl/.
note: ld: warning: directory not found for option '-L/Users/james/Code/rust-sdl/.rust'
Undefined symbols for architecture x86_64:
  "_SDL_main", referenced from:
      -[SDLMain applicationDidFinishLaunching:] in libSDLmain.a(SDLMain.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
make: *** [demos] Error 101