couldn't determine visual studio generator - visual-studio

I am trying to compile rust's azul gui framework sample code on windows 10 and it's running into the following error:
error: failed to run custom build command for `harfbuzz-sys v0.3.0 (https://github.com/maps4print/azul-dependencies?rev=bf2933b9aac43a7003278862772250398e4fa457#bf2933b9)`
Caused by:
process didn't exit successfully: `F:\Code\rust\azul_demo\target\debug\build\harfbuzz-sys-4d7deefbb1bf663c\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=HARFBUZZ_SYS_NO_PKG_CONFIG
--- stderr
thread 'main' panicked at '
couldn't determine visual studio generator
if VisualStudio is installed, however, consider running the appropriate vcvars script before building this crate
', C:\Users\Andrew\.cargo\git\checkouts\azul-dependencies-70bb1f94316762f9\bf2933b\cmake-0.1.35\src\lib.rs:687:25
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized
at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.29\src\backtrace\mod.rs:66
...
I installed cmake and visual studio 2019. Also note that I am using clion ide. Cmake version is 3.15.2.
It says I should run the appropriate vcvars script before building this crate, what does it mean exactly?
EDIT ----
Found vcvars.bat in the visual studio installation folder and ran it. It's still getting the same error.
EDIT2 ----
It looks like an incompatibility between the latest version of visualstudio(19) and cmake. Reverting to 2015 is suppose to resolve the issue.
https://github.com/maps4print/azul/issues/203

When you install Visual Studio, the command-line tools are not available from a generic command prompt. Visual Studio should have installed an entry in your start menu to start a properly configured console.
Or if you haven't started your console from this special entry, Visual Studio should also have installed a script called vcvars.bat somewhere in its install folder. You need to run that script before you can access the command-line tools.

Related

(Visual Studio Installation) Error 0x8007001d : Cannot write to the specified device

I can’t install Visual Studio Build tools.
when i want to launch the installation, a window appears telling me: writing impossible on the specified device.
I checked the logs and saw that there was an Error 0x8007001d
Also, I ran the installation with the command lines, I was able to download the files but then, when I run the command :
vs_buildtools.exe --noweb
It opens visual studio installer and I get the same Error 0x8007001d
You should know that without passing the command lines : vs_buildtools --layout d:\localVSlayout --lang fr-FR, I can’t download the packages in Visual Studio Installer
Have a good day

rust: link.exe not found

I installed the rust compiler and also MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.27) (as an individual component)
This does not seam to be working.
Does rust require anything more which I have not installed? Thank you in advance.
Install the Windows SDK too.
I also didn't want to install all of Visual Studio just to compile rust from the command line.
Based on the info in coder-256's link, I tried running C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat. Then, instead of being unable to find link.exe, I got the error:
note: LINK : fatal error LNK1181: cannot open input file 'advapi32.lib'
Searching Stack for that error led to this answer: Install the Windows SDK
So I installed the Windows 10 SDK, and now (after launching a new cmd window) it works.
Using Win11, here's the specific steps that worked for me (assumes VSCode and Rust are already installed):
Go to the Visual Studio Download site
Download Build Tools for Visual Studio 2019 (version 16.9)
Install
Create a "hello world" Rust project (cargo new hello)
Open project in VSCode
Set path info in launch.json file (located at folder root, may need to create this first)
Type Shift+Ctrl+B to build the Rust project

Unable to launch DAML studio

On MacOs, when I try to launch daml studio from command line, I receive several errors and it doesn't launch.
I have gone through all the installation requirements for DAML including installing Visual Studio Code which runs successfully on my Mac as well as the latest Java SDK. I went through the quickstart and DAML successfully works on my system using the IOU on http://localhost:4000. I updated %PATH correctly and have gone through the instructions twice to make sure I'm not missing anything.
Here is what I launch and the results that it is providing...
MacBook-Pro-2:quickstart aron.elston$ daml studio
/bin/sh: code: command not found
Failed to install DAML Studio extension from marketplace.
Installing bundled DAML Studio extension instead.
/bin/sh: code: command not found
Failed to install DAML Studio extension from SDK bundle.
Please open an issue on GitHub with the above message.
https://github.com/digital-asset/daml/issues/new?template=bug_report.md
/bin/sh: code: command not found
Failed to launch DAML studio. Make sure Visual Studio Code is installed.
See https://code.visualstudio.com/Download for installation instructions.
MacBook-Pro-2:quickstart aron.elston$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/aron.elston/.daml/bin
MacBook-Pro-2:quickstart aron.elston$ pwd
/Users/aron.elston/.daml/bin/quickstart
MacBook-Pro-2:quickstart aron.elston$
I would expect it to open the project in Visual Studio Code but instead I get errors as shown above.
Looks like the code command to launch VS code isn't available on the command line. That should be fixable by following the instructions here: https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line

Can't install cargo-tree: couldn't determine visual studio generator

I'm trying to install cargo-tree on my Windows machine. It uses Windows 10, Visual Studio build tools 15. This is my active rustup toolchain:
active toolchain
----------------
stable-x86_64-pc-windows-msvc (default)
rustc 1.26.0 (a77568041 2018-05-07)
When running cargo install cargo-tree, the build fails. The build log ends with:
error: failed to run custom build command for `libssh2-sys v0.2.7`
process didn't exit successfully: `C:\Users\NICOLA~1\AppData\Local\Temp\cargo-installt7F5FM\release\build\libssh2-sys-726b9e90a2ed2b95\build-script-build` (exit code: 101)
--- stderr
fatal: not a git repository (or any of the parent directories): .git
thread 'main' panicked at '
couldn't determine visual studio generator
if VisualStudio is installed, however, consider running the appropriate vcvars script before building this crate
', C:\Users\nicolas-delsaux\.cargo\registry\src\github.com-1ecc6299db9ec823\cmake-0.1.31\src\lib.rs:552:25
note: Run with `RUST_BACKTRACE=1` for a backtrace.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-tree v0.18.0`, intermediate artifacts can be found at `C:\Users\NICOLA~1\AppData\Local\Temp\cargo-installt7F5FM`
According to some documentation I found on the web, it seems to be related to some vcvars script to invoke, and an older Visual Studio version to install. I don't fully understand what to do so
Should I install an older version of Visual Studio?
Do I have some script to run?
According to #user25064, this requires installing the command through developer command prompt (and, more specifically, the developer command prompt for your architecture - take attention to x86/x64 architectures)

Setting Up .NET Build Environment with setenv - Two Warnings - Could not find vsvars32.bat Visual C++ Does not appear to be installed

I'm trying to compile some netmf firmware using MSBUILD with Yagarto. I'm doing it on a machine with VS2012 and all the right pre-requisites installed. From a command prompt as administrator, I go to the NetMF Porting Kit folder, where all the source code lives, I call setenv_gcc.cmd 4.6.0 c:\yagarto46
Doing so yields two warnings:
WARNING: Count not find vsvars32.bat
WARNING: VISUAL C++ DOES NOT APPEAR TO BE
INSTALLED ON THIS MACHINE.
When I try the above command from VS2012 Developer Command Prompt as Administrator I get the following ERROR
ERROR: Cannot determine the location of the VS Common Tools folder.
I've done the path modifications in Environment System Variables with no luck.
Thanks!
VS2010 command prompt gives error : Cannot determine the location of the VS Common Tools folder
I modified the vsvars32.bat file in the vs11 and vs10 folders accordingly and the error went away... Now onto eliminating my build errors....

Resources