I'm trying to make a basic image processing program in Rust for a course project, but I'm having trouble figuring out how to start. I've looked into using rust-png, but I'm having difficulty understanding how to use it as an external library as I'm unsure if I'm linking the files correctly. When I compile lib.rs to create the crate I get this error.
error: linking with `cc` failed: exit code: 1
note: cc arguments: '-m64' '-L/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-o' 'main' 'main.o' '-lmorestack' '-nodefaultlibs' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libnative-83574243-0.11-pre.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/libstd-aad93cea-0.11-pre.rlib' '/usr/local/lib/rustlib/x86_64-apple-darwin/lib/liblibc-8f65d5a8-0.10-pre.rlib' '-L/Users/brianuosseph/Desktop/Course_Work/Spring_2014/CS_4414/final_project/.rust' '-L/Users/brianuosseph/Desktop/Course_Work/Spring_2014/CS_4414/final_project' '-lpng' '-lz' '-lshim' '-lSystem' '-lc' '-lm' '-Wl,-rpath,@loader_path/../../../../../../../usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-Wl,-rpath,/usr/local/lib/rustlib/x86_64-apple-darwin/lib' '-lcompiler-rt'
note: ld: warning: directory not found for option '-L/Users/brianuosseph/Desktop/Course_Work/Spring_2014/CS_4414/final_project/.rust'
ld: library not found for -lshim
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: aborting due to previous error
I'm currently running on the 0.11-pre-nightly build of Rust.
For the project I'm just going to start with using libpng wrappings, but in the future I'd prefer to start from scratch and create my own PNG library for Rust. However, I simply don't know where to begin or if there are any existing image libraries for Rust, be it PNG, GIF or JPEG. Know of any?
rust-pngyou have to run./configurefirst, then runmake. The error in your question will go away (shimlibrary seems to be a very simple library compiled out ofshim.cfile in the same repository). - Vladimir Matveevgit cloned the library, ran./configure, editedMakefileto set path to Rust compiler and executedmake. Everything compiled just fine, I've got.rliband.solibraries. Maybe the library is just not adapted for Mac OS X. - Vladimir Matveev