nomicon icon indicating copy to clipboard operation
nomicon copied to clipboard

Add build script part to FFI chapter for more clear and smooth learn …

Open RoggeOhta opened this issue 1 year ago • 3 comments

Fix #345 #122 Make FFI chapter snappy example workable.

RoggeOhta avatar Jan 16 '24 15:01 RoggeOhta

@RoggeOhta Thank you thank you thank you. I've been banging my head wondering how on earth to reference snappy.

jamischarles avatar Feb 12 '24 18:02 jamischarles

FYI: on macOS I didn't need println!("cargo:rustc-link-lib=dylib=stdc++"); this line in the build script. In fact it caused an error note: ld: library 'stdc++' not found

jamischarles avatar Feb 12 '24 18:02 jamischarles

My working build file:

fn main() {
    // println!("cargo:rustc-link-lib=dylib=stdc++");
    println!("cargo:rustc-link-search=/Users/jac/dev/snappy/build");
}

Didn't realize I needed to ref the build folder

jamischarles avatar Feb 12 '24 18:02 jamischarles