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

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -