When I call the .wasm, the error is:Error: unknown import: `::` has not been defined

I compiled the C code through emscripten into .wasm file and tried calling it through Rust code.
Here is my C code:
so_runtime.h:

typedef struct tagSOCommInfo {
...
} SO_COMM_INFO_S;
unsigned int SORUN_GetSoInstId(void *pThis);

so_runtime.c:

SO_COMM_INFO_S* get_ctx_mgr_head(void *pthis) {
    if (pthis == NULL) {
        return NULL; // 或者处理错误
    }
    return (SO_COMM_INFO_S *)((unsigned char *)pthis - sizeof(SO_COMM_INFO_S));
}
unsigned int SORUN_GetSoInstId(void *pThis)
{
    if (pThis == 0) {
        return 0xFFFFFFFF;
    }

    SO_COMM_INFO_S *pstCommInfo = get_ctx_mgr_head(pThis);

    return (unsigned int)(pstCommInfo->ucInstSeq);
}

Here is my Rust code:

use wasi_common::sync::WasiCtxBuilder;
use wasmtime::*;
use std::ffi::c_void;

fn main() -> Result<()> {
    let engine = Engine::default();

    let mut linker = Linker::new(&engine);
    wasi_common::sync::add_to_linker(&mut linker, |s| s)?;

    let linking1 = Module::from_file(&engine, "so_runtime.wasm")?;

    let wasi = WasiCtxBuilder::new()
        .inherit_stdio()
        .inherit_args()?
        .build();
    let mut store = Store::new(&engine, wasi);

    //let memory_ty = MemoryType::new(1, None);
    //let memory = Memory::new(&mut store, memory_ty);
    let linking2 = Module::new(&engine, "(module (memory (import \"\" \"\") 1))")?;
    //let instance = Instance::new(&mut store, &linking2, &[memory.unwrap().into()])?;
    let linking2 = linker.instantiate(&mut store, &linking2)?;
    linker.instance(&mut store, "env", linking2)?;

    let linking1 = linker.instantiate(&mut store, &linking1)?;
    let this = std::ptr::null_mut::<c_void>();
    let this_ptr = this as i32;
    let foo = linking1.get_typed_func::<i32, u32>(&mut store, "SORUN_GetSoInstId")?;
    println!("result = {}", foo.call(&mut store, this_ptr)?);
    Ok(())
}

wasm can be compiled successfully, but when I use Rust code to run it will report an error, for this error I have tried many ways, but can not solve it, hope someone give me a hint, thank you very much!
Error: unknown import: :: has not been defined

Here is .wat file:

(module
  (type (;0;) (func (param i32) (result i32)))
  (type (;1;) (func))
  (import "env" "memory" (memory (;0;) 0))
  (func (;0;) (type 1))
  (func (;1;) (type 0) (param i32) (result i32)
    local.get 0
    i32.const 72
    i32.sub
    i32.const 0
    local.get 0
    select)
  (func (;2;) (type 0) (param i32) (result i32)
    local.get 0
    i32.eqz
    if  ;; label = @1
      i32.const -1
      return
    end
    local.get 0
    i32.const 61
    i32.sub
    i32.load8_u)
  (export "__wasm_call_ctors" (func 0))
  (export "__wasm_apply_data_relocs" (func 0))
  (export "get_ctx_mgr_head" (func 1))
  (export "SORUN_GetSoInstId" (func 2)))

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.