diff --git a/blockchain-sys/build.rs b/blockchain-sys/build.rs
index 0c75988ee44a6dfca56d5b703f147f276533cc80..b6287c0209b73ccf5a88e9337d2221cf7c24589a 100644
--- a/blockchain-sys/build.rs
+++ b/blockchain-sys/build.rs
@@ -13,7 +13,7 @@ fn main() {
     println!("cargo:rustc-link-search=native={}", dst.display());
     println!("cargo:rustc-link-lib=static=blockchain");
     // IMPROTANT: If we want to use C++, we also need to link the C++ stdlib.
-    println!("cargo:rustc-flags=-ldylib=stdc++");
+    println!("cargo:rustc-link-lib=dylib=stdc++");
 
     // Use rust-bindgen to generate a "header" for Rust from the C header.
     // Of couse Rust does not have any headers, so this will be a normal Rust file containing an extern "C" {} block.