brson / rust-sdl

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

Compiling on OS X - unresolved name std::as_c_str, std::as_buf #76

Closed rikthevik closed 11 years ago

rikthevik commented 11 years ago

Just cloned the master branch of rust this morning.

$ rustc --version
rustc 0.8-pre (4cf3072 2013-07-25 05:22:44 -0700)
host: x86_64-apple-darwin

Getting the following errors on make. I don't know enough about Rust (yet) to fix this myself, so I figured I'd throw it over the wall at you guys.

$ make
rustc --cfg image --cfg mixer --cfg mac_dylib src/sdl.rc -o libsdl.dummy
src/video.rs:496:19: 496:32 error: unresolved name `str::as_c_str`.
src/video.rs:496                 do str::as_c_str("rb") |mode_buf| {
                                    ^~~~~~~~~~~~~
src/video.rs:495:15: 495:28 error: unresolved name `str::as_c_str`.
src/video.rs:495             do str::as_c_str(path.to_str()) |buf| {
                                ^~~~~~~~~~~~~
src/video.rs:621:19: 621:32 error: unresolved name `str::as_c_str`.
src/video.rs:621                 do str::as_c_str("wb") |mode_buf| {
                                    ^~~~~~~~~~~~~
src/video.rs:620:15: 620:28 error: unresolved name `str::as_c_str`.
src/video.rs:620             do str::as_c_str(path.to_str()) |buf| {
                                ^~~~~~~~~~~~~
src/wm.rs:38:5: 38:18 error: unresolved name `str::as_c_str`.
src/wm.rs:38        do str::as_c_str(icon) |icon_buf| {
                       ^~~~~~~~~~~~~
src/wm.rs:37:4: 37:17 error: unresolved name `str::as_c_str`.
src/wm.rs:37    do str::as_c_str(title) |title_buf| {
                   ^~~~~~~~~~~~~
src/img.rs:54:4: 54:15 error: unresolved name `str::as_buf`.
src/img.rs:54     str::as_buf(file.to_str(), |buf, _len| {
                  ^~~~~~~~~~~
src/mixer.rs:117:19: 117:32 error: unresolved name `str::as_c_str`.
src/mixer.rs:117                 do str::as_c_str("rb") |mode_buf| {
                                    ^~~~~~~~~~~~~
src/mixer.rs:116:15: 116:28 error: unresolved name `str::as_c_str`.
src/mixer.rs:116             do str::as_c_str(path.to_str()) |buf| {
                                ^~~~~~~~~~~~~
src/sdl.rs:161:7: 161:20 error: unresolved name `str::as_c_str`.
src/sdl.rs:161     do str::as_c_str(err) |buf| {
                      ^~~~~~~~~~~~~
error: aborting due to 10 previous errors
make: *** [libsdl.dummy] Error 101
AngryLawyer commented 11 years ago

I think this is fixed by #77 - I'll be merging it in as soon as I check it's compiled.

AngryLawyer commented 11 years ago

Fixed

rikthevik commented 11 years ago

What was the problem? Nothing jumped out at me at first glance.

(Thank you for looking into this btw)

AngryLawyer commented 11 years ago

No problem.

https://github.com/brson/rust-sdl/commit/77400b747a8e92ad0fe793c03fb5adeeeb87da48

SDL mixer and SDL image aren't built on ones, so aren't always compiled for everyone - there were one or two left over here.