I have separated my project into three crates:
feed-forward
mnist_data
main
When I attempt to
use feed_forward::perceptron::*;
in my parent main.rs file, I receive this error (I know it’s this specific statement in particular since it compiles and runs completely fine when I comment out the use statement, even if it’s completely unused in the main.rs file):
= note: libfeed_forward-91895a3937a5cb25.rlib(feed_forward-91895a3937a5cb25.4d5wjsid97q4jz3w.rcgu.o) : error LNK2019: unresolved external symbol cblas_ddot referenced in function _ZN7ndarray6linalg11impl_linalg110_$LT$impl$u20$ndarray..ArrayBase$LT$S$C$ndarray..dimension..dim..Dim$LT$$u5b$usize$u3b$$u20$1$u5d$$GT$$GT$$GT$8dot_impl17hc13566f916e454e7E libfeed_forward-91895a3937a5cb25.rlib(feed_forward-91895a3937a5cb25.4d5wjsid97q4jz3w.rcgu.o) : error LNK2019: unresolved external symbol cblas_sdot referenced in function _ZN7ndarray6linalg11impl_linalg110_$LT$impl$u20$ndarray..ArrayBase$LT$S$C$ndarray..dimension..dim..Dim$LT$$u5b$usize$u3b$$u20$1$u5d$$GT$$GT$$GT$8dot_impl17hc13566f916e454e7E C:ProgrammingRustProjectsRustMLtargetdebugdepsRustML.exe : fatal error LNK1120: 2 unresolved externals
When I attempt to run the feed-forward crate’s main.rs, it builds completely fine.
From this error message, it seems it can’t locate some ndarray function?
Here is an image of my directory structure and main cargo.toml illustrate the situation:
image of directory structure with explanation
parent cargo.toml:
workspace = { members = ["feed-forward", "mnist_data"] }
[package]
name = "RustML"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
ndarray = "0.15.6"
ndarray-stats = "0.5.1"
ndarray-linalg = "0.16.0"
mnist = "0.6.0"
mnist_data = { path = "mnist_data" }
feed-forward = { path = "feed-forward" }
rustup -Vv output:
> rustup -Vv
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.75.0 (82e1608df 2023-12-21)`
rustup show output:
> rustup show
Default host: x86_64-pc-windows-msvc
rustup home: C:Users|||.rustup
installed toolchains
--------------------
stable-x86_64-pc-windows-gnu
stable-x86_64-pc-windows-msvc (default)
nightly-2020-05-14-x86_64-pc-windows-msvc
installed targets for active toolchain
--------------------------------------
wasm32-unknown-unknown
x86_64-pc-windows-msvc
active toolchain
----------------
stable-x86_64-pc-windows-msvc (default)
rustc 1.75.0 (82e1608df 2023-12-21)
I have tried using the gnu toolchain instead but it doesn’t compile so that went out the window immediately.
For your convenience, here is a no-push, frozen, READ-ONLY branch of my repository, beware that the mnist_data crate downloads the MNIST data set (~12MB) from a Google drive and unzips the contents into a /data/ directory, so obviously don’t run code you don’t trust, but you shouldn’t even need to run it; building it causes the same problem.
https://github.com/ew9170/RustML/tree/stack_overflow_freeze
Things I have attempted:
Running cargo clean
, deleting the /target directory, deleting the entire directory and cloning the repository from scratch
trying the different permutations of cargo.toml dependency orders:
ndarray = "0.15.6"
ndarray-stats = "0.5.1"
ndarray-linalg = "0.16.0"
mnist = "0.6.0"
mnist_data = { path = "mnist_data" }
feed-forward = { path = "feed-forward" }
mnist_data = { path = "mnist_data" }
feed-forward = { path = "feed-forward" }
ndarray = "0.15.6"
ndarray-stats = "0.5.1"
ndarray-linalg = "0.16.0"
mnist = "0.6.0"
feed-forward = { path = "feed-forward" }
mnist_data = { path = "mnist_data" }
ndarray = "0.15.6"
ndarray-stats = "0.5.1"
ndarray-linalg = "0.16.0"
mnist = "0.6.0"
I have also tried changing my use
statement order (both before and after any ndarray use statements)
At this point I’m out of ideas, any help would be appreciated.
EatonWu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.