Include standard library function definitions in static library

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Include standard library function definitions in static library

580件の閲覧回数
tarun1
Contributor I

Hi, I am creating a static library in MCUXpresso IDE. I am using redlib for importing `stdlib.h` in my code. It successfully builds a static library. However, some of the standard library functions such as "malloc", "exit" are undefined in the static library. I verified that using `nm` command. 

The problem is that I plan to use this static library in rust using ffi. And when I try to load the static library in my rust code I get error `rust-lld: error: undefined symbol: malloc`. How can I include these definitions in my static library?

 

0 件の賞賛
返信
1 返信

551件の閲覧回数
ErichStyger
Specialist I
these functions like malloc() are part of the C/C++ standard library. You will have to either combine your library with the standard library or link your Rust application with it too.
0 件の賞賛
返信