0
votes

enter image description hereI'm using rust-cpython to make a python module in rust. I've run my code on a linux os and it runs just fine but I get the familiar "linking with cc failed:exit code 1 error". I've gathered from this that I need to add the .cargo/config file to my project as suggested at the bottom of this:

https://github.com/dgrunwald/rust-cpython

I've copied and pasted their code into a file, config.toml, and place there in a directory, .cargo. I've tried nesting this in my src directory and my project directory with no success, what am I missing?

1
Are you sure you put the file in PROJECT_DIR/.cargo/config? You can check if the arguments get passed properly by running cargo build -vvvtheduke
So compiling the code with cargo rustc --release -- -C link-arg=-undefined -C link-arg=dynamic_lookup builds with no problem, leading me to assume it is that the build can't see the config file. the dir structure is project/src/lib.rs and I've tried placing .cargo/config.toml in either project/ or project/src and neither work. I also tried in ~/.cargo/config.toml and in all these places not within a .cargo hidden dir.Alesi Rowland
It's not config.toml, just config.theduke

1 Answers

1
votes

Solution found: Thought I'd post it as this gave me grief.

Everything with this setup is fine except the config file can't have the extension .toml despite being written in a toml format