-
Notifications
You must be signed in to change notification settings - Fork 461
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
CXX Variable not set #2246
Comments
It should, but something must be going wrong in the discovery phase. Could you set the |
|
Thank you. The way kit scanning identifies the CXX compiler is that it substitutes |
I don't know if this proves that those compilers exists, but I can try: [pablo@Harazel ~]$ whereis clang
clang: /usr/bin/clang /usr/lib/clang /usr/include/clang /usr/share/clang /usr/share/man/man1/clang.1.gz
[pablo@Harazel ~]$ whereis clang++
clang++: /usr/bin/clang++
[pablo@Harazel ~]$ whereis clang++-12
clang++-12:
[pablo@Harazel ~]$ whereis gcc-9
gcc-9: /usr/bin/gcc-9
[pablo@Harazel ~]$ whereis g++-9
g++-9: /usr/bin/g++-9
[pablo@Harazel ~]$ whereis gcc-10
gcc-10: /usr/bin/gcc-10
[pablo@Harazel ~]$ whereis g++-10
g++-10: /usr/bin/g++-10
[pablo@Harazel ~]$ Also I can do this:
If this info is not usefull for you, I can provide new one :D |
This explains the missing CXX for clang-12 in the Kit you shared since clang++-12 does not appear in that list.
For g++, the cmake command line you shared was using |
I encountered the same problem. I think it is caused by the clang package of Manjaro (or Arch Linux, but I'm not sure). It only creates Update: it seems that the latest compiler package on Arch Linux never uses names like |
Yes, but I dind't choose to use that specific gcc, so that compiler was choose too by the search engine. |
I don't understand. Your screenshot shows it selected in the status bar. We populate the list of choices, but we let you (the developer) pick. If you don't like the one you previously selected, you can click on that text and pick a different one. If you want CMake to pick your compiler automatically instead of us, pick the option called |
If I choose |
It sounds like @waterlens comment points out the actual issue then? If you configure outside of VS Code just using the CLI (and you don't set the CMAKE_C[XX]_COMPILER), do you have the same problem? If your distro creates only |
The latest gcc package on Arch Linux use the following names:
The latest clang package:
@bobbrow |
So it sounds like our scanning logic isn't going to pair the C/CXX compilers the way you want by default. In this case, you can create your own Kits file and configure it the way you want. Documentation: https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/kits.md#project-kits |
It sounds not good. Arch Linux frequently updates the compiler and I have to modify the configure each time :( |
But it does on other Linux distros? |
Yes, it does because you have both the C and CXX named compilers on Debian. I see two options for Arch:
|
I mean, you can't simply replace gcc with g++ or clang with clang++ here. Line 295 in 1aa15ff
Line 360 in 1aa15ff
As it detects for me:
The code simply detects |
Brief Issue Summary
Visual Studio Code Version: 1.62.2
OS Version: Linux x64 5.13.19-2-MANJARO
Extension Version: 1.9.1 (Latest?)
CXX variable is not set when I try to scan active kits.
As you can see, I set my kit to a compiler that is not a defaulted system one (my default gcc/g++ compiler is gcc-11)
Then, if I generate my project, cmake give me this output:
As you can see, the variable
CMAKE_C_COMPILER
is set, but not theCMAKE_CXX_COMPILER
one.If I try on a Debian OS, both variables are set when I scan for Active kits
So to solve this "problem" I modified the file
${HOME}/.local/share/CMakeTools/cmake-tools-kits.json
and added manually allCXX
variables.For example:
Generated by automated searching kits:
CXX Variable is not set, so I added a new entry:
This happens with al compilers, and versions.
CXX variable should not be added too automatically?
The text was updated successfully, but these errors were encountered: