Where is clang++ command under windows?

Hi,

trying to learn Clang from a book, it gives a clang++ command line

  • it is linux only ? I work on win 10 with 15.0.6 binaries, the only clang exe has no ++ in its name

  • also, clang.exe -Xclang -ast-dump -fsyntax-only test.cpp used to work, now it complains about the options I use

thanks for your help

PS *****\clang_llvm_training> .\binaries\clangd_15.0.6\bin\clangd.exe -### -std=c++11 -Wall .\simple.cpp -o simple.exe
clangd.exe: Unknown command line argument '-###'.  Try: '*****\clang_llvm_training\binaries\clangd_15.0.6\bin\clangd.exe --help'
clangd.exe: Did you mean '--log'?
clangd.exe: Unknown command line argument '-std=c++11'.  Try: '*****\clang_llvm_training\binaries\clangd_15.0.6\bin\clangd.exe --help'
clangd.exe: Did you mean '--log=c++11'?
clangd.exe: Unknown command line argument '-Wall'.  Try: '*****\clang_llvm_training\binaries\clangd_15.0.6\bin\clangd.exe --help'
clangd.exe: Did you mean '--help'?
clangd.exe: Unknown command line argument '.\simple.cpp'.  Try: '*****\clang_llvm_training\binaries\clangd_15.0.6\bin\clangd.exe --help'
clangd.exe: Unknown command line argument '-o'.  Try: '*****\clang_llvm_training\binaries\clangd_15.0.6\bin\clangd.exe --help'
clangd.exe: Did you mean '-h'?
clangd.exe: Unknown command line argument 'simple.exe'.  Try: '*****\clang_llvm_training\binaries\clangd_15.0.6\bin\clangd.exe --help'

I don’t know about the clang++ bit, but you are running ClangD (https://clangd.llvm.org/) there not clang. Perhaps like me, you have been caught out by Windows tab completion yet again :slight_smile:

Looking at my Linux builds, clang++ and clang are symlinks to the clang-17 binary.

$ file ./bin/clang++
./bin/clang++: symbolic link to clang-17

I know Windows does not /does not out of the box support symlinks. So that may be why the build only has a clang.exe, perhaps we didn’t want to make another copy just to rename it?

yeah we can use mklink, but I guess clang++ is like clang.exe

yet even with clang.exe I just downloaded from 15.0.6 no usual parameter work anymore
I could to -Xlang, now I get tons of errors

what am I missing ?


what am I missing ?

You’re running clangd not clang.

On Thu, 13 Apr 2023 at 14:33, Phil via LLVM Discussion Forums <notifications@llvm.discoursemail.com> wrote:

phil1234578910
April 13

what am I missing ?


Visit Topic or reply to this email to respond.

To unsubscribe from these emails, click here.

where can I get clang binaries ?

If you’re following a book you may want to match the release with the version the book used. In that case, have a look at the previous release pages https://releases.llvm.org/.

is one of these compatible with win 10 ?
image

You want either of these depending on your system:

image

ok my bad I found it below (I guess)
image

and clang++.exe is installing apparently :slight_smile:

1 Like

The windows installer comes with a lot of executables. clang.exe clang++.exe clang-cl.exe … are all part of it. I think only some experimental programs are not part of it. Though most of them are even included, it even has perl and python scripts bundled.