Questions tagged [rust-cargo]

Cargo is the official package manager for the Rust programming language.

Cargo is the official package manager for the Rust programming language. Using a manifest, the programmer can provide metadata about a project, including dependencies, which Cargo can automatically download and compile before compiling the project itself.

You can find more information in the cargo book and browse the crates (Rust packages) in crates.io.

2044 questions
0
votes
1 answer

Println! causes OpenGL program to not work?

I am currently developing a simple program in rust to draw a colored triangle to the screen. I followed the instructions from OpenGL. My program was working fine and the triangle rendered as expected: After that I tried abstracting the code: The…
DerAnonyme
  • 580
  • 8
0
votes
1 answer

SVG Example not loading the SVG image in other system in iced library for rust

I tried building the svg example present in the iced libaray. The system in which it was build, it is working as exepected (i.e., the tiger SVG image is loading) but if I'm trying to run it in different machine(laptop), then the SVG image is not…
0
votes
0 answers

Failed to cargo release build `libc v0.2.142` on Mac M1

I have a rust project which is failing to do a release build because it can't build libc v0.2.142. Weirdly cargo build works. Compiling libc v0.2.142 Running…
twitu
  • 553
  • 6
  • 12
0
votes
0 answers

error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1 | rust compilation error

On a windows 11 machine. I ran cargo build and received this error: error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1 I am using `rusqlite:"0.29.0", and this is my tomo file [package] name = "backend-rust" version = "0.1.0" edition…
0
votes
1 answer

Futures-Util version issue

My code was working fine until today I got the error error: the 'rustc.exe' binary, normally provided by the 'rustc' component, is not applicable to the 'stable-x86_64-pc-windows-msvc' toolchain I fixed it with rustup toolchain install stable After…
Zubayr
  • 457
  • 4
  • 18
0
votes
1 answer

Deleting workspace Cargo.toml triggers version error

I'm reading a rust project. Deleting the workspace cargo.toml and run test in eth_rpc_client gives out following error. I'm speculating if there's something around patch.crate-io, but cargo.toml of eth_rpc_client use same version as workspace…
Paul Yu
  • 15
  • 4
0
votes
1 answer

Creating comments with umya spreadsheet for specific cell

Im using umya spreadsheet to edit a xlsx file and want to add a comment with the changed cells. I am very new to rust and it could be that i am missing something, but i cantf find a way to specify coordinate of a comment. I am using umya spreadsheet…
Luca
  • 19
  • 4
0
votes
1 answer

rust / SWC plugin / how to test jsx?

I'm trying to create a plugin by doing the documentation - https://swc.rs/docs/plugin/ecmascript/getting-started I have simplified the example. The plugin doesn't change anything. test!( Default::default(), |_| as_folder(TransformVisitor), …
Roman
  • 175
  • 2
  • 3
  • 15
0
votes
0 answers

Rust compilation error: failed to run custom build command for `clang-sys v1.6.1`

I am trying to build a Rust program on Centos with kernel 6.20. When trying to compile a Rust file I keep getting the following error messages. cargo build --manifest-path=atropos/Cargo.toml --release Compiling proc-macro2 v1.0.56 Compiling…
Perry
  • 1
0
votes
0 answers

dependency upgrade and downgrade puzzler

I thought I understaood dependency resolutions in rust, but clearly I dont. I am working on a large project and it has this dep tempfile = "3.4" cargo tree says PS C:\play\gitui> cargo tree -i tempfile tempfile v3.4.0 └── asyncgit v0.22.1…
pm100
  • 48,078
  • 23
  • 82
  • 145
0
votes
1 answer

How to include a platform-specific example, or only compile the example conditionally

Is it possible to conditionally include an [[example]]? I have an example which only runs on *nix, so it causes errors on windows. I'm trying to avoid writing #[cfg(not(target_family = "windows"))] on every single top-level item in main.rs, and I…
Mingwei Samuel
  • 2,917
  • 1
  • 30
  • 40
0
votes
0 answers

How to install ImageMagick for RUST with the given link ON WINDOWS?

I'm struggling for 2 days to install ImageMagick for Rust on Windows. There is this crate that uses it: https://crates.io/crates/magick_rust/0.17.0 Anyways, there is a guide to install for windows. It doesn't work for me! Can anyone try to set it up…
0
votes
1 answer

vscode does not work when it has multiple cargo projects?

I'm learning to use rust,i am using vscode。 I have two cargo projects in my workspace,Why rust-analyzer only has an error message in the first project, but not in the second。 Is there any setting required?
Itsme
  • 76
  • 5
0
votes
0 answers

Magick unable to install for Rust on Windows

I'm building a imageconverter with tauri rust (and typescript react). One of the dependencies is: image-convert = "0.13.0" It needs Rust dependency under the hood to work. I followed the instructions from the guide i found on the link. That's my…
0
votes
0 answers

ELF error: Multiple or no text sections, consider removing llc option: -function-sections

Right now, I am working with cosmwasm and trying to deploy the cw-plus smart contracts. I was able to run the cargo cli cargo build-bpf but couldn't deploy it by using cli solana program deploy . I encountered this issue: Error:…