diff --git a/build.rs b/build.rs index ca8571f..433fb3e 100644 --- a/build.rs +++ b/build.rs @@ -28,6 +28,10 @@ fn get_config() -> PathBuf { fn print_config() { println!("cargo:rustc-link-lib=static=winbridge"); println!("cargo:rustc-link-lib=dylib=user32"); + #[cfg(target_env = "gnu")] + println!("cargo:rustc-link-lib=dylib=gdiplus"); + #[cfg(target_env = "gnu")] + println!("cargo:rustc-link-lib=dylib=stdc++"); } #[cfg(target_os = "linux")] diff --git a/native/libwinbridge/bridge.cpp b/native/libwinbridge/bridge.cpp index ede2528..91ff5a4 100644 --- a/native/libwinbridge/bridge.cpp +++ b/native/libwinbridge/bridge.cpp @@ -27,7 +27,15 @@ #define UNICODE +#ifdef __MINGW32__ +# ifndef WINVER +# define WINVER 0x0606 +# endif +# define STRSAFE_NO_DEPRECATE +#endif + #include +#include #include #include