linker - Linking to the MariaDB C Connector from Rust fails on Windows -
i working on rust project requires me connect mariadb server. have decided create rust bindings officially provided c connector, works fine in linux, not on windows.
since msvc-binaries provided download, don't work due linker issues between microsft linker , mingw linker used rust cause program crash when first function called, tried compile mariadb sources myself, though compilation under mingw should work of 2.0 release of mariadb, fails with
error: conflicting types ssize_t
typedef ssize_t ssize_t
since has been defined in file, , when tried remove redefinition, other errors occured.
i tried cross-compile arch using mingw-w64-mariadb-connector-c package, did not show compilation errors connector, when tested binaries on windows, threw undefined reference linking error every of c-function declarations, this:
extern crate libc; use self::libc::{c_int, /*...*/}; #[link(name="mariadb", kind="dylib")] extern { pub fn mysql_init(mysql: *const mysql) -> c_int; // ... }
i tried this suggestion mysql-c-connector, same linker errors appeared.
i using newest rust nightlies , mingw-w64 v4.9.1 (the same version in nightlies), both 32 bit.
Comments
Post a Comment