tencent-im-sys

Crates.iotencent-im-sys
lib.rstencent-im-sys
version0.1.0
created_at2026-01-15 14:07:59.559224+00
updated_at2026-01-15 14:07:59.559224+00
description[Unofficial] Tencent IM SDK Rust FFI Bindings
homepage
repositoryhttp://github.com/poohpooher/tencent-im-sys
max_upload_size
id2045637
size682,839
(poohpooher)

documentation

https://docs.rs/tencent-im-sys/latest/tencent-im-sys/

README

tencent-im-sys

[Unofficial Crate]

This crate is an unofficial crate created because the official Tencent IM SDK does not support Rust.

Target Tencent IM SDK Version : TIM SDK 8.8.7354

Build Requirement

https://rust-lang.github.io/rust-bindgen/requirements.html

How Use

After creating an sdk directory in the project's Manifest Dir, place TIM.lib and TIM.dll of Tencent IM SDK.


// build.rs

use std::fs;
use std::path::{Path, PathBuf};

fn main() {
    let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
    let mut sdk_path = PathBuf::new(manifest_dir);
    sdk_path.push("sdk");

    println!("cargo:rustc-link-search=native={}", sdk_path.display());
    println!("cargo:rustc-link-lib=static=ImSDK");

    println!("cargo:rerun-if_changed=build.rs");
    println!("cargo:rerun-if-changed=sdk/ImSDK.lib");

    // Copy dll
    let out_dir = env::var("OUT_DIR").unwrap();
    let dest_path = Path::new(&out_dir).join("../../../").join("ImSDK.dll");

    let dll_src = "sdk/ImSDK.dll";
    fs::copy(dll_src, dest_path).unwrap();
}

Commit count: 0

cargo fmt