Installed but cannot use or do anything due to "fragments" and not being able to find "cargo.toml" in any parent folder

I'm a complete noob to any of this, I literally just needed it to run one program over from MACOS to Windows, but I'm not understanding anything that's going on. I've been trying to get this to work for 24 hours now, tried cargo clean like some posts said but that does nothing without cargo.toml as well.

C:\Users\..\.cargo>cargo install gifski --features=video
    Updating crates.io index
  Installing gifski v1.5.1
warning: output filename collision.
The bin target `gifski` in package `gifski v1.5.1` has the same output filename as the lib target `gifski` in package `gifski v1.5.1`.
Colliding filename is: C:\Users\...\AppData\Local\Temp\cargo-installV9yHOk\release\gifski.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling winapi v0.3.9
   Compiling cfg-if v1.0.0
   Compiling glob v0.3.0
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling bindgen v0.54.0
   Compiling regex-syntax v0.6.25
   Compiling lazy_static v1.4.0
   Compiling once_cell v1.8.0
   Compiling peeking_take_while v0.1.2
   Compiling shlex v0.1.1
   Compiling bytemuck v1.7.2
error: linker `link.exe` not found
  |
  = note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

error: could not compile `memchr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installV9yHOk`

Caused by:
  build failed

C:\Users\...\.cargo>cargo clean
error: could not find `Cargo.toml` in `C:\Users\...\.cargo` or any parent directory

C:\Users\...\.cargo>cargo install gifski
    Updating crates.io index
  Installing gifski v1.5.1
warning: output filename collision.
The bin target `gifski` in package `gifski v1.5.1` has the same output filename as the lib target `gifski` in package `gifski v1.5.1`.
Colliding filename is: C:\Users\...\AppData\Local\Temp\cargo-installWcSHpm\release\gifski.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
   Compiling cfg-if v1.0.0
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling once_cell v1.8.0
   Compiling winapi v0.3.9
   Compiling bytemuck v1.7.2
   Compiling autocfg v1.0.1
   Compiling crc32fast v1.2.1
   Compiling crossbeam-utils v0.8.5
   Compiling adler v1.0.2
   Compiling lazy_static v1.4.0
   Compiling bitflags v1.3.2
   Compiling unicode-width v0.1.9
   Compiling color_quant v1.1.0
error: linker `link.exe` not found
  |
  = note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

   Compiling weezl v0.1.5
error: could not compile `crossbeam-utils` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installWcSHpm`

C:\Users\...\.cargo>cargo check
error: could not find `Cargo.toml` in `C:\Users\...\.cargo` or any parent directory

You can fix this error by installing the Visual C++ Build Tools.

It looks like gifski may also require you to download the ffmpeg libraries and set an environment variable pointing to their location. For details, see:

Or you can download a pre-compiled version of gifski from https://gif.ski/ instead of compiling it yourself.

Interesting, I'll see if I can get that to work. As for the gifski stuff, I've already got everything ffmpeg-wise, as I do understand enough of that; what drew me here is that some of the features, namely the ability to use mp4s, required a cargo installation as opposed to the painstaking process of manually cutting videos into frames with ffmpeg and putting them together again.

The Visual C++ tools is odd because I think I should already have that, but I don't know how to check. I'll definitely do it and try again in a second however.

Same issues and text after restarting and opening with the visual studio and then just normally in the terminal.

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>cargo install gifski --features=video
    Updating crates.io index
  Installing gifski v1.5.1
warning: output filename collision.
The bin target `gifski` in package `gifski v1.5.1` has the same output filename as the lib target `gifski` in package `gifski v1.5.1`.
Colliding filename is: C:\Users\...\AppData\Local\Temp\cargo-installme3ok3\release\gifski.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling winapi v0.3.9
   Compiling cfg-if v1.0.0
   Compiling glob v0.3.0
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling bindgen v0.54.0
   Compiling regex-syntax v0.6.25
   Compiling bitflags v1.3.2
   Compiling peeking_take_while v0.1.2
   Compiling once_cell v1.8.0
   Compiling bytemuck v1.7.2
error: linker `link.exe` not found
  |
  = note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

   Compiling shlex v0.1.1
error: could not compile `memchr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installme3ok3`

Caused by:
  build failed

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>cargo clean
error: could not find `Cargo.toml` in `C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools` or any parent directory

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>

Have you tried (re-)installing the Visual C++ Build Tools?

Note that it is not enough just to have Visual Studio. You also need to select specific components for C++ development. This page has some more details if you are using the Visual Studio installer rather than downloading the C++ build tools directly.

You don't need to run cargo clean here. This is only useful after building source code that you have downloaded yourself, not when downloading it from crates.io with cargo install.

I had downloaded the C++ build tools directly and then the Visual Studio, if I'm not mistaken by the links on the first page and the download instructions.

And my bad on the cargo clean thing, that's the only solution I'd seen for the cargo.toml file being missing. If there's nothing else that can help resolve the issues involving that and the

error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installme3ok3`

error, how do I just uninstall everything and be sure everything involing rust and cargo is gone? I've just done rustup uninstall before each try (about five now, thinking it just needed to be redownloaded and would be right that time), but this is fairly frustrating.

According to this previous discussion, running your cargo install command via the “Native Tools Command Prompt” might fix the link.exe error. (I believe this is a shortcut that gets installed when you install the C++ build tools.)

After running rustup uninstall, I believe you can completely get rid of any remaining files by removing the .cargo folder in your home directory, and any folder starting with cargo under the AppData\Local\Temp directory.

I appreciate it. Wish I could also figure out what the fragments stuff means and the cargo.toml, but I don't see any solutions here for exactly what I'm looking for; guessing just deleting everything is the best option, once I find the App Data folder (the path they're suggesting literally isn't on my computer?). I appreciate the help, even if the problem wasn't solved. I know I'm probably frustrating to talk to involving this stuff since I'm an idiot, but I'm happy you were nice about everything.

I'm not sure what you mean by "fragments." What does this refer to?

It looks like the only problem is that the Rust compiler isn't able to find the linker for some reason. Using the Native Tools Command Prompt may fix this.

But if you just want to install gifski, downloading it from https://gif.ski/ should definitely be easier than installing and using Rust/Cargo.

Deleted the .cargo and .rustup files, just to update.

If there's anyway to do a clean install with everything intact, let me know, but just going from the .exe apparently isn't working on my machine for whatever or with my pea-brain (lol).

Sorry, artifacts :slight_smile:

error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installV9yHOk`

Caused by:
  build failed

That's the issue, I do have a version of it from the link you've sent already, but when trying to run a specific task (ie. parsing a mp4 into a gif), if says to do "cargo install gifski --features video" or something along those lines without any other option. The base form just calls for you to literally rip every frame from an mp4 into pngs with ffmpeg and then convert the frames into a gif. I can do that, but that is incredibly tedious as you can imagine. That's the only reason I'm trying to get this Rust/cargo thing to work, honestly, just convenience with one app. I'm not used to the few CLI tools I use giving me this much of a hassle beyond pretty simple text entry.

error: could not compile `memchr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installV9yHOk`

Caused by:
  build failed

I was able to find the folder in which the cargo-install folders resided, but I can't tell what's wrong with them or what the artifacts would be. Should I delete them all?

You can delete these. These are temporary files created during the failed builds. Normally they would be deleted automatically, but Cargo kept them around after the error in case they were needed for debugging.

1 Like

Thanks again. Not sure what the "artifacts" in the folders are supposed to mean, but I deleted them all. If there is a proper way to download/run the rust .exe from the start, I'm all ears, but nothing has worked thus far; I appreciate the help and the cordiality of everything. The Native Command Prompt solution lead to… you guessed it… the same error.

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>cargo install gifski --features=video
    Updating crates.io index
  Downloaded gifski v1.5.1
  Downloaded 1 crate (32.1 KB) in 0.40s
  Installing gifski v1.5.1
  Downloaded adler v1.0.2
  Downloaded cexpr v0.4.0
  Downloaded crc32fast v1.2.1
  Downloaded cfg-if v1.0.0
  Downloaded getrandom v0.2.3
  Downloaded imgref v1.9.1
  Downloaded gifsicle v1.92.5
  Downloaded natord v1.0.9
  Downloaded pkg-config v0.3.20
  Downloaded libloading v0.5.2
  Downloaded rgb v0.8.27
  Downloaded textwrap v0.11.0
  Downloaded ahash v0.7.6
  Downloaded bytemuck v1.7.2
  Downloaded bitflags v1.3.2
  Downloaded dunce v1.0.2
  Downloaded cfg-if v0.1.10
  Downloaded imagequant v3.1.0
  Downloaded gif v0.11.3
  Downloaded once_cell v1.8.0
  Downloaded miniz_oxide v0.4.4
  Downloaded shlex v0.1.1
  Downloaded regex v1.5.4
  Downloaded vcpkg v0.2.15
  Downloaded unicode-xid v0.2.2
  Downloaded crossbeam-channel v0.5.1
  Downloaded winapi v0.3.9
  Downloaded lazycell v1.3.0
  Downloaded pbr v1.0.4
  Downloaded quick-error v2.0.1
  Downloaded atty v0.2.14
  Downloaded bindgen v0.54.0
  Downloaded fallible_collections v0.4.3
  Downloaded color_quant v1.1.0
  Downloaded lodepng v3.4.6
  Downloaded imagequant-sys v3.1.0+sys2.16.0
  Downloaded quote v1.0.10
  Downloaded resize v0.7.2
  Downloaded regex-syntax v0.6.25
  Downloaded crossbeam-utils v0.8.5
  Downloaded flate2 v1.0.22
  Downloaded memchr v2.4.1
  Downloaded nom v5.1.2
  Downloaded glob v0.3.0
  Downloaded cc v1.0.71
  Downloaded version_check v0.9.3
  Downloaded libc v0.2.104
  Downloaded unicode-width v0.1.9
  Downloaded clang-sys v0.29.3
  Downloaded peeking_take_while v0.1.2
  Downloaded lazy_static v1.4.0
  Downloaded gif-dispose v3.1.1
  Downloaded proc-macro2 v1.0.30
  Downloaded strsim v0.8.0
  Downloaded weezl v0.1.5
  Downloaded clap v2.33.3
  Downloaded wild v2.0.4
  Downloaded autocfg v1.0.1
  Downloaded ffmpeg-next v4.4.0
  Downloaded num_cpus v1.13.0
  Downloaded ffmpeg-sys-next v4.4.0
  Downloaded rustc-hash v1.1.0
  Downloaded hashbrown v0.11.2
  Downloaded time v0.1.43
  Downloaded vec_map v0.8.2
  Downloaded 65 crates (4.8 MB) in 4.27s (largest was `winapi` at 1.2 MB)
warning: output filename collision.
The bin target `gifski` in package `gifski v1.5.1` has the same output filename as the lib target `gifski` in package `gifski v1.5.1`.
Colliding filename is: C:\Users\...\AppData\Local\Temp\cargo-installbsX8Ec\release\gifski.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling winapi v0.3.9
   Compiling cfg-if v1.0.0
   Compiling memchr v2.4.1
   Compiling glob v0.3.0
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling regex-syntax v0.6.25
   Compiling bindgen v0.54.0
   Compiling lazycell v1.3.0
   Compiling bytemuck v1.7.2
   Compiling once_cell v1.8.0
   Compiling peeking_take_while v0.1.2
error: linker `link.exe` not found
  |
  = note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

error: could not compile `memchr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installbsX8Ec`

Caused by:
  build failed

I'm just convinced that I'm cursed at this point, seeing as literally nothing I've found online has helped.

does gifski support the gnu toolchain?

I think you could do the following to compile with the gnu toolchain and avoid headaches with the msvc linker:

rustup target add x86_64-pc-windows-gnu
cargo install gifski --target=x86_64-pc-windows-gnu

I'm not sure what implications that would have though.

1 Like

I have to be totally honest with you, I have absolutely zero idea what that means. If you don't mind, could you briefly explain or link something? I'm a total novice to this kind of stuff, the most tech-whiz stuff I can do is use basic command line programs and make basic websites with knowledge from one coding class in college lol. I think me running into the same issue seemingly no one else seems to have is proof enough that I don't know what I'm doing.

Tried it, didn't work.

cargo install gifski --features=video --target=x86_64-pc-windows-gnu
    Updating crates.io index
  Downloaded gifski v1.5.1
  Downloaded 1 crate (32.1 KB) in 0.67s
  Installing gifski v1.5.1
  Downloaded adler v1.0.2
  Downloaded cfg-if v1.0.0
  Downloaded ffmpeg-next v4.4.0
  Downloaded clap v2.33.3
  Downloaded natord v1.0.9
  Downloaded libc v0.2.104
  Downloaded proc-macro2 v1.0.30
  Downloaded shlex v0.1.1
  Downloaded rustc-hash v1.1.0
  Downloaded cexpr v0.4.0
  Downloaded atty v0.2.14
  Downloaded crossbeam-channel v0.5.1
  Downloaded crossbeam-utils v0.8.5
  Downloaded gif v0.11.3
  Downloaded imagequant-sys v3.1.0+sys2.16.0
  Downloaded libloading v0.5.2
  Downloaded quick-error v2.0.1
  Downloaded textwrap v0.11.0
  Downloaded time v0.1.43
  Downloaded bytemuck v1.7.2
  Downloaded wild v2.0.4
  Downloaded crc32fast v1.2.1
  Downloaded color_quant v1.1.0
  Downloaded lodepng v3.4.6
  Downloaded nom v5.1.2
  Downloaded regex-syntax v0.6.25
  Downloaded resize v0.7.2
  Downloaded vec_map v0.8.2
  Downloaded cc v1.0.71
  Downloaded fallible_collections v0.4.3
  Downloaded imgref v1.9.1
  Downloaded hashbrown v0.11.2
  Downloaded lazycell v1.3.0
  Downloaded pkg-config v0.3.20
  Downloaded weezl v0.1.5
  Downloaded bindgen v0.54.0
  Downloaded glob v0.3.0
  Downloaded getrandom v0.2.3
  Downloaded imagequant v3.1.0
  Downloaded num_cpus v1.13.0
  Downloaded strsim v0.8.0
  Downloaded unicode-xid v0.2.2
  Downloaded version_check v0.9.3
  Downloaded dunce v1.0.2
  Downloaded once_cell v1.8.0
  Downloaded ahash v0.7.6
  Downloaded clang-sys v0.29.3
  Downloaded winapi v0.3.9
  Downloaded gif-dispose v3.1.1
  Downloaded miniz_oxide v0.4.4
  Downloaded pbr v1.0.4
  Downloaded autocfg v1.0.1
  Downloaded unicode-width v0.1.9
  Downloaded flate2 v1.0.22
  Downloaded peeking_take_while v0.1.2
  Downloaded rgb v0.8.27
  Downloaded gifsicle v1.92.5
  Downloaded winapi-x86_64-pc-windows-gnu v0.4.0
  Downloaded quote v1.0.10
  Downloaded bitflags v1.3.2
  Downloaded lazy_static v1.4.0
  Downloaded memchr v2.4.1
  Downloaded vcpkg v0.2.15
  Downloaded ffmpeg-sys-next v4.4.0
  Downloaded regex v1.5.4
  Downloaded cfg-if v0.1.10
  Downloaded 66 crates (7.7 MB) in 6.89s (largest was `winapi-x86_64-pc-windows-gnu` at 2.9 MB)
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling winapi v0.3.9
   Compiling cfg-if v1.0.0
   Compiling glob v0.3.0
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling regex-syntax v0.6.25
   Compiling bindgen v0.54.0
   Compiling winapi-x86_64-pc-windows-gnu v0.4.0
   Compiling bitflags v1.3.2
error: linker `link.exe` not found
  |
  = note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

error: could not compile `memchr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-install8ZceIp`

Caused by:
  build failed

New error upon restarting:

cargo install gifski --features=video
    Updating crates.io index
  Installing gifski v1.5.1
warning: output filename collision.
The bin target `gifski` in package `gifski v1.5.1` has the same output filename as the lib target `gifski` in package `gifski v1.5.1`.
Colliding filename is: C:\Users\...\AppData\Local\Temp\cargo-installX2OD2e\release\gifski.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling winapi v0.3.9
   Compiling cfg-if v1.0.0
   Compiling glob v0.3.0
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling regex-syntax v0.6.25
   Compiling bindgen v0.54.0
   Compiling lazy_static v1.4.0
   Compiling cfg-if v0.1.10
   Compiling once_cell v1.8.0
   Compiling bytemuck v1.7.2
   Compiling bitflags v1.3.2
   Compiling lazycell v1.3.0
   Compiling rustc-hash v1.1.0
   Compiling shlex v0.1.1
   Compiling peeking_take_while v0.1.2
   Compiling autocfg v1.0.1
   Compiling pkg-config v0.3.20
   Compiling vcpkg v0.2.15
   Compiling crossbeam-utils v0.8.5
   Compiling crc32fast v1.2.1
   Compiling adler v1.0.2
   Compiling color_quant v1.1.0
   Compiling ffmpeg-next v4.4.0
   Compiling weezl v0.1.5
   Compiling unicode-width v0.1.9
   Compiling imgref v1.9.1
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling quick-error v2.0.1
   Compiling dunce v1.0.2
   Compiling natord v1.0.9
   Compiling getrandom v0.2.3
   Compiling rgb v0.8.27
   Compiling nom v5.1.2
   Compiling ahash v0.7.6
   Compiling clang-sys v0.29.3
   Compiling textwrap v0.11.0
   Compiling miniz_oxide v0.4.4
   Compiling gif v0.11.3
   Compiling wild v2.0.4
   Compiling gif-dispose v3.1.1
   Compiling num_cpus v1.13.0
   Compiling libloading v0.5.2
   Compiling imagequant-sys v3.1.0+sys2.16.0
   Compiling gifsicle v1.92.5
   Compiling regex v1.5.4
   Compiling crossbeam-channel v0.5.1
   Compiling quote v1.0.10
   Compiling hashbrown v0.11.2
   Compiling flate2 v1.0.22
   Compiling fallible_collections v0.4.3
   Compiling resize v0.7.2
   Compiling lodepng v3.4.6
   Compiling imagequant v3.1.0
   Compiling cexpr v0.4.0
   Compiling atty v0.2.14
   Compiling time v0.1.43
   Compiling clap v2.33.3
   Compiling pbr v1.0.4
   Compiling ffmpeg-sys-next v4.4.0
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installX2OD2e`

Caused by:
  failed to run custom build command for `ffmpeg-sys-next v4.4.0`

Caused by:
  process didn't exit successfully: `C:\Users\...\AppData\Local\Temp\cargo-installX2OD2e\release\build\ffmpeg-sys-next-b4bbd485d19d26f3\build-script-build` (exit code: 101)
  --- stdout
  Could not find ffmpeg with vcpkg: Could not find Vcpkg tree: No vcpkg installation found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'
  cargo:rerun-if-env-changed=LIBAVUTIL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libavutil\"", cause: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." } }', C:\Users\...\.cargo\registry\src\github.com-1ecc6299db9ec823\ffmpeg-sys-next-4.4.0\build.rs:701:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I was more thinking out loud; I don't know anything about gifski. I suggest trying the commands I posted and seeing if they are successful. The (hopefully) worst that can happen is they still don't work.

Explanation: Rust supports two toolchains for compiling on Windows: x86_64-pc-windows-msvc, which uses the Microsoft provided Visual C tools (e.g. link.exe), and x86_64-pc-windows-gnu which uses an alternative, open source, set of tools (also called "mingw"). I have heard of other people who, after having a hard time getting Rust to correctly locate link.exe (the same error you are getting) were able to use the alternative gnu toolchain to successful compile projects.

1 Like

I ended up trying it, did not work sadly.

cargo install gifski --features=video --target=x86_64-pc-windows-gnu
    Updating crates.io index
  Downloaded gifski v1.5.1
  Downloaded 1 crate (32.1 KB) in 0.67s
  Installing gifski v1.5.1
  Downloaded adler v1.0.2
  Downloaded cfg-if v1.0.0
  Downloaded ffmpeg-next v4.4.0
  Downloaded clap v2.33.3
  Downloaded natord v1.0.9
  Downloaded libc v0.2.104
  Downloaded proc-macro2 v1.0.30
  Downloaded shlex v0.1.1
  Downloaded rustc-hash v1.1.0
  Downloaded cexpr v0.4.0
  Downloaded atty v0.2.14
  Downloaded crossbeam-channel v0.5.1
  Downloaded crossbeam-utils v0.8.5
  Downloaded gif v0.11.3
  Downloaded imagequant-sys v3.1.0+sys2.16.0
  Downloaded libloading v0.5.2
  Downloaded quick-error v2.0.1
  Downloaded textwrap v0.11.0
  Downloaded time v0.1.43
  Downloaded bytemuck v1.7.2
  Downloaded wild v2.0.4
  Downloaded crc32fast v1.2.1
  Downloaded color_quant v1.1.0
  Downloaded lodepng v3.4.6
  Downloaded nom v5.1.2
  Downloaded regex-syntax v0.6.25
  Downloaded resize v0.7.2
  Downloaded vec_map v0.8.2
  Downloaded cc v1.0.71
  Downloaded fallible_collections v0.4.3
  Downloaded imgref v1.9.1
  Downloaded hashbrown v0.11.2
  Downloaded lazycell v1.3.0
  Downloaded pkg-config v0.3.20
  Downloaded weezl v0.1.5
  Downloaded bindgen v0.54.0
  Downloaded glob v0.3.0
  Downloaded getrandom v0.2.3
  Downloaded imagequant v3.1.0
  Downloaded num_cpus v1.13.0
  Downloaded strsim v0.8.0
  Downloaded unicode-xid v0.2.2
  Downloaded version_check v0.9.3
  Downloaded dunce v1.0.2
  Downloaded once_cell v1.8.0
  Downloaded ahash v0.7.6
  Downloaded clang-sys v0.29.3
  Downloaded winapi v0.3.9
  Downloaded gif-dispose v3.1.1
  Downloaded miniz_oxide v0.4.4
  Downloaded pbr v1.0.4
  Downloaded autocfg v1.0.1
  Downloaded unicode-width v0.1.9
  Downloaded flate2 v1.0.22
  Downloaded peeking_take_while v0.1.2
  Downloaded rgb v0.8.27
  Downloaded gifsicle v1.92.5
  Downloaded winapi-x86_64-pc-windows-gnu v0.4.0
  Downloaded quote v1.0.10
  Downloaded bitflags v1.3.2
  Downloaded lazy_static v1.4.0
  Downloaded memchr v2.4.1
  Downloaded vcpkg v0.2.15
  Downloaded ffmpeg-sys-next v4.4.0
  Downloaded regex v1.5.4
  Downloaded cfg-if v0.1.10
  Downloaded 66 crates (7.7 MB) in 6.89s (largest was `winapi-x86_64-pc-windows-gnu` at 2.9 MB)
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling winapi v0.3.9
   Compiling cfg-if v1.0.0
   Compiling glob v0.3.0
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling regex-syntax v0.6.25
   Compiling bindgen v0.54.0
   Compiling winapi-x86_64-pc-windows-gnu v0.4.0
   Compiling bitflags v1.3.2
error: linker `link.exe` not found
  |
  = note: The system cannot find the file specified. (os error 2)

note: the msvc targets depend on the msvc linker but `link.exe` was not found

note: please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 was installed with the Visual C++ option

error: could not compile `memchr` due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-install8ZceIp`

Caused by:
  build failed

The additional error I'm getting now after resetting and redownloading the CC++ tools:

cargo install gifski --features=video
    Updating crates.io index
  Installing gifski v1.5.1
warning: output filename collision.
The bin target `gifski` in package `gifski v1.5.1` has the same output filename as the lib target `gifski` in package `gifski v1.5.1`.
Colliding filename is: C:\Users\...\AppData\Local\Temp\cargo-installX2OD2e\release\gifski.pdb
The targets should have unique names.
Consider changing their names to be unique or compiling them separately.
This may become a hard error in the future; see <https://github.com/rust-lang/cargo/issues/6313>.
   Compiling libc v0.2.104
   Compiling version_check v0.9.3
   Compiling cc v1.0.71
   Compiling winapi v0.3.9
   Compiling cfg-if v1.0.0
   Compiling glob v0.3.0
   Compiling memchr v2.4.1
   Compiling proc-macro2 v1.0.30
   Compiling unicode-xid v0.2.2
   Compiling regex-syntax v0.6.25
   Compiling bindgen v0.54.0
   Compiling lazy_static v1.4.0
   Compiling cfg-if v0.1.10
   Compiling once_cell v1.8.0
   Compiling bytemuck v1.7.2
   Compiling bitflags v1.3.2
   Compiling lazycell v1.3.0
   Compiling rustc-hash v1.1.0
   Compiling shlex v0.1.1
   Compiling peeking_take_while v0.1.2
   Compiling autocfg v1.0.1
   Compiling pkg-config v0.3.20
   Compiling vcpkg v0.2.15
   Compiling crossbeam-utils v0.8.5
   Compiling crc32fast v1.2.1
   Compiling adler v1.0.2
   Compiling color_quant v1.1.0
   Compiling ffmpeg-next v4.4.0
   Compiling weezl v0.1.5
   Compiling unicode-width v0.1.9
   Compiling imgref v1.9.1
   Compiling vec_map v0.8.2
   Compiling strsim v0.8.0
   Compiling quick-error v2.0.1
   Compiling dunce v1.0.2
   Compiling natord v1.0.9
   Compiling getrandom v0.2.3
   Compiling rgb v0.8.27
   Compiling nom v5.1.2
   Compiling ahash v0.7.6
   Compiling clang-sys v0.29.3
   Compiling textwrap v0.11.0
   Compiling miniz_oxide v0.4.4
   Compiling gif v0.11.3
   Compiling wild v2.0.4
   Compiling gif-dispose v3.1.1
   Compiling num_cpus v1.13.0
   Compiling libloading v0.5.2
   Compiling imagequant-sys v3.1.0+sys2.16.0
   Compiling gifsicle v1.92.5
   Compiling regex v1.5.4
   Compiling crossbeam-channel v0.5.1
   Compiling quote v1.0.10
   Compiling hashbrown v0.11.2
   Compiling flate2 v1.0.22
   Compiling fallible_collections v0.4.3
   Compiling resize v0.7.2
   Compiling lodepng v3.4.6
   Compiling imagequant v3.1.0
   Compiling cexpr v0.4.0
   Compiling atty v0.2.14
   Compiling time v0.1.43
   Compiling clap v2.33.3
   Compiling pbr v1.0.4
   Compiling ffmpeg-sys-next v4.4.0
error: failed to compile `gifski v1.5.1`, intermediate artifacts can be found at `C:\Users\...\AppData\Local\Temp\cargo-installX2OD2e`

Caused by:
  failed to run custom build command for `ffmpeg-sys-next v4.4.0`

Caused by:
  process didn't exit successfully: `C:\Users\...\AppData\Local\Temp\cargo-installX2OD2e\release\build\ffmpeg-sys-next-b4bbd485d19d26f3\build-script-build` (exit code: 101)
  --- stdout
  Could not find ffmpeg with vcpkg: Could not find Vcpkg tree: No vcpkg installation found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'
  cargo:rerun-if-env-changed=LIBAVUTIL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-pc-windows-msvc
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_pc_windows_msvc
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Command { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libavutil\"", cause: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." } }', C:\Users\...\.cargo\registry\src\github.com-1ecc6299db9ec823\ffmpeg-sys-next-4.4.0\build.rs:701:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

At every turn, something new it seems; I couldn't find any solutions to this and the developer seemed a bit puzzled in solving it on one thread. I guess it puts me at ease that this isn't necessarily easy for everyone.

failed to run custom build command for `ffmpeg-sys-next v4.4.0`

A few more comments on different boards seem to suggest that this is a lot more trouble than I was expecting. I appreciate the help here, especially from @mbrubeck who actually helped me learn a decent bit indirectly about Rust despite me really just coming for one app.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.