Thanks Mikhail,
I tried removing the "lang_items" entry in the feature list but I got the
same error.
So some hit and trial got me this and it seems to work
#![crate_name = "rustcode"]
#![crate_type = "staticlib"]
#![feature(lang_items)]
#![no_std]
#[lang="sized"]
#[no_mangle]
pub extern "C" fn rust_func() -> int {
return 1234444;
}
#[lang = "stack_exhausted"] extern fn stack_exhausted() {}
Regards,
Kashyap
On Sun, Nov 9, 2014 at 11:35 PM, Mikhail Zabaluev <
[email protected]> wrote:
> Hi,
>
> 2014-11-09 19:33 GMT+02:00 C K Kashyap <[email protected]>:
>
>>
>> I am attempting to implement some functions in Rust that I'd like to call
>> from my existing C app. Here's what I tried - I created a rust file as
>> follows -
>>
>> #![crate_name = "rustcode"]
>> #![crate_type = "staticlib"]
>> #![no_std]
>> #![feature(globs, asm, lang_items)]
>>
>> #[no_mangle]
>> pub extern "C" fn rust_func() {}
>>
>>
>>
>> When I compile it using rustc, I get
>>
>> error: requires `sized` lang_item
>> error: aborting due to previous erro
>>
>
> Try removing feature(lang_items).
>
> Mikhail
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev