-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuration - cl.exe installed with 'Build Tools for Visual Studio' not detected #4929
Comments
Hi @pedro-w . It looks like you are using "Build Tools for Visual Studio 2019", and do not have Visual Studio 2019 (Preview) installed. Is that correct? If so, it looks like we may not be detecting the install location for Build Tools correctly. |
@Colengms yes, correct, it was "Build Tools for Visual Studio 2019" from https://visualstudio.microsoft.com/downloads/#other |
I was trying to see if I could help diagnose the cause myself but I can't find where in the code it actually looks for the compilers. I assume it's something to do with the |
Yeah, if you don't see the build tools for VS in the knownCompilers, then it's not being found by our closed source language server component. |
I thought I was losing my marbles when I couldn't find the code for setting knownCompilers! Anyway please let me know if I can provide any more info to help. |
Hi @pedro-w . I'm having trouble repro'ing this. I created a fresh VM (without VS), installed the VS 2019 Build Tools (with C++ Build Tools checked), opened a new folder in VS Code (with no Attempting the above and selecting Compiler detection is done in our native exe. We iterate through all directories found under the following path: |
I'll check the fresh install stuff but it might take me a while to set up a VM etc. I can say straight away that I don't have the
I have installed and uninstalled Visual Studio 2019 Community in the past and maybe that has caused some confusion in the configuration. |
OK I have made some progress. I installed VS code and the Build tools on a real Windows 10 PC which had never had either on before. Everything worked as you describe. I saw that Back on my PC, I found another path on my D: drive (I've got a small SSD C: and a larger HDD D:) which was It's quite likely I told the VS installer at some point to put stuff on D:\ because my C:\ drive was getting full. The VS Installer itself seems to be OK with this (and the tools themselves are actually installed to C:) so I don't know if this is in their remit to change or yours? Anyway it's not difficult just to set the compiler path manually, though having just gone through the 'automatic' process on a fresh PC, it's really impressive how straightforward you've made it. Thanks! [edit]
with the value
so maybe you should be looking in there? |
@pedro-w . Thanks for digging into this. I think you are absolutely correct. |
Fixed in our latest Insiders release: https://github.com/microsoft/vscode-cpptools/releases/tag/0.27.0-insiders. |
I have installed the insiders release and am happy to report that the drop-down now contains the correct path to the compiler. I was able to follow the "Configure VS Code for Microsoft C++" article that I mentioned above from beginning to end. Thanks for your help with this! Quick question - since I also have the MSVC 32-bit compilers and the cross compilers installed, I would have expected them to be in the drop-down too, but only the 64-bit native compiler was listed. Is this what you would expect? |
The bitness of the compiler shown doesn't currently have any effect for cl.exe in regards to IntelliSense, which can have its bitness changed via the msvc-x64 or msvc-x86 intelliSenseMode settings. |
I am following the instructions in https://code.visualstudio.com/docs/cpp/config-msvc
When I get to step 2, in the Compiler Path box I see a red "(No compiler paths detected)"
From the command prompt,
cl.exe
is definitely on the path.I can set it manually in the
c_cpp_properties.json
- should beC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.24.28314\bin\HostX64\x64
- but the docs imply that the extension should be able to pick this up automatically.VS Code version: 1.41.1
C/C++ extension version: 0.26.3
Compilers: Visual Studio 2019 Developer Command Prompt v16.4.4
(not installed Visual Studio, just the command line tools)
The text was updated successfully, but these errors were encountered: