LLVM Visual Studio Integration Failed - visual-studio

I'm trying to integrate LLVM with Visual Studio 15 2017, however I seem to be unable to get it to work. When running the LLVM installer after Visual Studio has been installed, I get a command prompt with the following error:
Installing MSVC integration...
Failed to find MSBuild toolsets directory.
MSVC integration install failed.
Press any key to continue . . .
After some research online, I found this SO link which has lead me to believe that the LLVM installer does not know how to install for VS15. As such, I tried installing the toolset found here manually. Now, I can see LLVM listed as a toolset in Visual Studio:
However, when I choose it as an option and try to compile a simple "Hello World" program, I get the following error:
error MSB8020: The build tools for LLVM-vs2017 (Platform Toolset = 'LLVM-vs2017') cannot be found.
To build using the LLVM-vs2017 build tools, please install LLVM-vs2017 build tools.
Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Retarget solution".
Is there something I am doing wrong here, or some step I missed when trying to get these two tools integrated?

LLVM Visual Studio Integration Failed
After the test, you should execute the AutoSetup.bat to install the LLVM 6.0.0 automatically.
Plasmacel provided a fork which is updated for LLVM 6.0.0 and provides better integration by providing include and library paths of LLVM/clang. In the file README.MD, you can find the some more details, like Automatic Installation:
Automatic Installation
Open a command prompt with Administrator rights
(DO NOT OPEN AutoSetup.bat with admin rights it won't load the files)
Go to the folder where AutoSetup.bat exists and type "AutoSetup"
If Automatic doesn't work, you can also go to the Manual Installation.
Hope this helps.

Related

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

Which "Individual Component" from the Visual Studio installer is suitable for Rust development?

I have a fully updated install of Visual Studio Enterprise 2017 (currently 15.9.2) on my machine, and I want to do some Rust coding. The Rust installer tells me to install "Visual C++" build tooling, but I can't seem to figure out which one is needed.
That is, I tried installing "VC++ 2017 version 15.9 v14.16", but when I do cargo run on my hello world application, it halts with a message:
error: linker link.exe not found
I don't want to go rampant and install all the C++ components in the installer, just the one I need. I'd prefer to install it as part of the Visual Studio installer, if possible.
Which "Individual Component" in the Visual Studio installer do I need for Rust?
Here's what's currently checked:
As a workaround, I was advised to run rustup default stable-x86_64-pc-windows-gnu which at least allows me to run the hello world example. (Or perhaps this is in fact a proper solution even?)
Installing any "VC++ toolset" should be enough to get cargo run to link properly. It looks like the minimum dependencies are:
Required dependencies are VC++ 2017 version 15.7 v14.14 latest v141 tools and Windows 10 SDK (10.0.17134.0)
Note that VC does not add its tools to the path (so that you can have multiple versions of the MS toolchain installed in parallel). Instead it adds entries to your Start menu like: "VC++ 2017 version 15.9 v14.16 command prompt" (not sure of the name), that allow you to start a command prompt with the proper path. This should also be possible from a VS toolbar button or menu entry.
You can't start cargo from a generic command prompt, you need to open the prompt with one of the above solutions.
Alternatively, you need to run c:\path\to\your\VS\installation\VCVARS.BAT inside your prompt to set the correct path before running cargo.

Visual Studio 2015 - Clang version not found when building from command line

I have a Xamarin-based solution in Visual Studio 2015. One of the projects is an Android native shared library containing C++ code.
When I build the solution from within VS 2015 IDE, everything works as expected. However, when I try to build the solution from the command line I get an error.
The build command is:
msbuild mytest.sln /p:Configuration=Release /p:Platform=ARM /t:Rebuild
The error I get is:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for Clang_3_8 (Platform Toolset = 'Clang_3_8') cannot be found. To build using the Clang_3_8 build tools, please install Clang_3_8 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...".
My Visual Studio 2015 has all the updates applied. Wondering if anyone knows what the problem could be. Is it a path problem? Regards.
Turned out it is a path problem. Make sure to use the developer command prompt link under Program Files-->Visual Studio 2015->Visual Studio Tools. This batch file sets up proper paths, including the one for clang.

CMake does not find Windows SDK 8.1

I am trying to download a C program called fluidsynth (https://sourceforge.net/p/fluidsynth) so that I can later install python bindings and use it in some code.
I installed CMake and Visual Studio. From the VS command line (as an administrator) I gave the command cmake c:\path\to\fluidsynth. I got a few errors:
In the command line, I got No CMAKE_C_COMPILER could be found.
In the CMake error log it says Build FAILED Then:
error MSB8036: The Windows SDK version 8.1 was not found.
Install the required version of Windows SDK or change the
SDK version in the project property pages or by right-clicking
the solution and selecting "Retarget solution".
[C:\Users\user\Desktop\fluidsynth-1.1.6\CMakeFiles\3.4.3\CompilerIdC\CompilerIdC.vcxproj]
This error persists even after upgrading my Windows SDK.
1.- Visual Basic?? CMake doesn't have native support for VB.
2.- If you are going to use CMake, you must be ensure that Win SDK is propertly registered its paths.
3.- Once is done, you only need to run, from the directory you extracted the files, the following command: cmake . if you still get errors, then something is not correctly registered nor installed. That wouldn't be cmake fault.

Compiling FFTW source in Visual studio

Recently I am trying to compile the source code of FFTW in Visual studio 2010. I followed the instruction from the FFTW website. I downloaded the source code fftw-3.3.2.zip and corresponding vs 2010 package fftw-3.3-libs-visual-studio-2010.zip.
I got four projects from the solution, bench, benchf, libfftw-3.3, libfftwf-3.3
But on compiling I got following errors on each of the project:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x64.Targets(514,5): error MSB8008: Specified platform toolset (Windows7.1SDK) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
which points to the following content
I have tried the debug/release build for both x64 and win32, none of them worked.
Could anyone please help me on this?
It seems that it can be solved without installing the Windows 7.1 SDK
Right click on the 'libfftw-3.3' project and selected properties
Go to Configuration Properties -> General
Switch 'Platfrom Toolset' from 'Windows7.1SDK' to 'v100'
Recompile
Works for the projects 'libfftwf-3.3' and 'libfftw-3.3'
The project 'bench' and 'benchf' are failing to build:
fatal error C1083: Cannot open source file: '....\libbench2\aligned-main.c': No such file or directory
Can be solved by removing the aligned-main.c from both projects.
You can also use CMake - I created this CMake file for fftw-3.3.2 which I tested with Visual Studio 2010 x64:
https://bitbucket.org/Vertexwahn/cmakedemos/src/670f189321d89dbd61ddc8c446c91578305f9da2/fftw-3.3.2/CMakeLists.txt?at=default
You also need this config.h file:
https://bitbucket.org/Vertexwahn/cmakedemos/src/670f189321d89dbd61ddc8c446c91578305f9da2/fftw-3.3.2/config.h?at=default
It looks like you need to install the Windows 7.1 SDK, if you have already installed it, try reinstalling it incase it is corrupted.
You can download the 7.1 SDK from http://www.microsoft.com/en-us/download/details.aspx?id=8279

Resources