can someone tell me, how to generate a .h file with .so file in my rust cdylib project
if it cannot automatically do, please tell me how to do it manually , step by step , from writing header to connecting it and running it in saple C program
Apart from aforementioned cbindgen, you can write a C header by hand. You need to know what functions Rust program exports (C can't call any random Rust function, but only functions with #[no_mangle] extern annotation) and write matching prototypes in C syntax.
You can't use CString as an argument. It's not actually a C-compatible string. It's a helper object for making pointers to C-compatible strings, but it's not a string pointer itself. You have to use *const char in arguments.