Skip to content

static linking doesn't seem to work #313

@bd-wluo

Description

@bd-wluo

Hello, I'm using rust_icu in my code and static linking doesn't seem to work. I did verify dynamic linking (i.e., the default) works.

This is my main.rs

use rust_icu::sys::{UErrorCode, versioned_function};

fn main() {
    let bytes = vec![1, 2, 3, 4];
    let mut signature_length: i32 = 0;
    let mut p_error_code: UErrorCode = UErrorCode::U_ZERO_ERROR;
    unsafe {
        let _result = versioned_function!(ucnv_detectUnicodeSignature)(
            bytes.as_ptr() as *const std::os::raw::c_char,
            bytes.len() as i32,
            &mut signature_length,
            &mut p_error_code,
        );
    }
}

This is my Cargo.toml:

[package]
name = "testicu"
version = "0.1.0"
edition = "2024"

[dependencies]
rust_icu_sys = { version = "5.0.0", features = ["static"] }

When compiling, I got the following error:

$ cargo build
   Compiling rust_icu_sys v5.0.0
error: overriding linking modifiers from command line is not supported

error: could not compile `rust_icu_sys` (lib) due to 1 previous error

Can you please confirm whether this is a bug or if I'm doing something wrong? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions