From a29ff4e0419524de97de0e7016e8eafa9a005a3a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 29 May 2024 13:56:26 +0200 Subject: [PATCH] that might be the fix --- libcsp-cargo-build/src/lib.rs | 1 + libcsp-rust/build.rs | 3 ++- libcsp-rust/src/lib.rs | 7 +++++++ libcsp-rust/src/main.rs | 7 +------ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/libcsp-cargo-build/src/lib.rs b/libcsp-cargo-build/src/lib.rs index 83c99b7..77fbc50 100644 --- a/libcsp-cargo-build/src/lib.rs +++ b/libcsp-cargo-build/src/lib.rs @@ -49,6 +49,7 @@ impl Builder { .file("libcsp/src/csp_debug.c") .file("libcsp/src/csp_id.c") .file("libcsp/src/csp_iflist.c") + .file("libcsp/src/csp_conn.c") .file("libcsp/src/csp_init.c") .file("libcsp/src/csp_io.c") .file("libcsp/src/csp_port.c") diff --git a/libcsp-rust/build.rs b/libcsp-rust/build.rs index 2da85d3..020b784 100644 --- a/libcsp-rust/build.rs +++ b/libcsp-rust/build.rs @@ -27,7 +27,8 @@ fn main() { // Tell cargo to tell rustc to link our `csp` library. Cargo will // automatically know it must look for a `libcsp.a` file. println!("cargo:rustc-link-lib=csp"); - println!("cargo:rustc-link-search={}/csp", project_dir); + println!("cargo:rustc-link-lib=csp"); + // println!("cargo:rustc-link-search={}/csp", project_dir); let mut csp_builder = Builder::new(); csp_builder.compile(); diff --git a/libcsp-rust/src/lib.rs b/libcsp-rust/src/lib.rs index f082531..0912036 100644 --- a/libcsp-rust/src/lib.rs +++ b/libcsp-rust/src/lib.rs @@ -2,6 +2,13 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] +// include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +extern "C" { + pub fn csp_print_func(fmt: *const ::std::os::raw::c_char, ...); + #[doc = " Initialize CSP.\n This will configure basic structures."] + pub fn csp_init(); +} + // include!(concat!(env!("OUT_DIR"), "/bindings.rs")); // extern "C" { // pub fn csp_print_func(fmt: *const ::std::os::raw::c_char, ...); diff --git a/libcsp-rust/src/main.rs b/libcsp-rust/src/main.rs index 4684f96..5042df1 100644 --- a/libcsp-rust/src/main.rs +++ b/libcsp-rust/src/main.rs @@ -1,9 +1,4 @@ -// include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -extern "C" { - pub fn csp_print_func(fmt: *const ::std::os::raw::c_char, ...); - #[doc = " Initialize CSP.\n This will configure basic structures."] - pub fn csp_init(); -} +use libcsp_rust::csp_init; fn main() { println!("Hello, world!");