Closed
Description
The project below fails to build using rustc -o bin/logging2 crate.rc
with error main function not found
. If rustc -o bin/logging2 --lib crate.rc
is used it complains about missing crate link meta 'name', using 'logging2' as default
and missing crate link meta 'vers', using '0.0' as default
.
Makefile:
RUSTC ?= rustc
dummy1 := $(shell mkdir bin 2> /dev/null)
all:
$(RUSTC) -o bin/logging2 crate.rc
#$(RUSTC) -o bin/logging2 --lib crate.rc
check:
$(RUSTC) -o bin/test-logging2 --test crate.rc
export RUST_LOG=test-logging2::logging2=3 && ./bin/test-logging2
clean:
rm -rf bin
crate.rc:
use std;
#[link(name = "logging2",
vers = "0.1",
uuid = "91E62841-B9F3-4721-97C6-621BEEE2DA1B")]
#[crate_type = "lib"]
mod logging2;
logging2.rs:
#[test]
fn test_logging()
{
error!("error level");
warn!("warn level");
info!("info level");
}
This is with a rust from master on Sep 1, 2012.