Skip to content

Dependencies of libimagequant Built with mingw-w64-i686-rust in MSYS2/MinGW32 #123

@Dimoks

Description

@Dimoks

Hello,

I am building a project in the MSYS2/MinGW32 environment (32-bit, targeting Win32) and using the libimagequant library, compiled from source with cargo build --release using the mingw-w64-i686-rust package. The resulting libimagequant_sys.a library appears to require linking against ws2_32, userenv, and ntdll libraries to resolve symbols such as WSAStartup, GetUserProfileDirectoryW, NtReadFile, and RtlNtStatusToDosError.

Could you please clarify the following:

  1. Does the version of libimagequant built with mingw-w64-i686-rust include dependencies on ws2_32, userenv, and ntdll due to the Rust standard library (std) or other reasons? If so, what specific functionality in libimagequant or its dependencies triggers the need for these libraries (e.g., networking, user profile access, or low-level I/O)?
  2. Is it expected and normal for a library like libimagequant, which is primarily used for image processing, to pull in these dependencies when built with Rust? Are there any potential side effects or risks (e.g., increased binary size or unintended functionality) when linking against these libraries?
  3. Is there a recommended way to build libimagequant in MSYS2/MinGW32 (e.g., using the C version instead of Rust) to avoid these dependencies, such as compiling without the Rust standard library (no-std) or using a different build method?

Any insights or recommendations on how to minimize unnecessary dependencies while maintaining compatibility with MinGW32 would be greatly appreciated.

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