I need to install Clang because QT requires it for some components. I tried the prebuilt version but that seems to have hardcoded paths to GCC or Visual Studio. I guessed this because when I try to compile the short “Hello World” program it complains that it can’t find Visual Studio. I’ve just downloaded the sources and something similar happens when I run cmake PATH
Where PATH is the path to the LLVM sources. Several errors are displayed but they all complain about the same thing.
CMake Error at CMakeLists.txt:50 (project):
is not a full path and was not found in the PATH.
It is stated that cmake will attempt to find the toolset to use but that is not correct as I have MinGW installed and PATH correctly set up so if I type gcc –version I get
gcc (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
I get something similar if I type g++ --version but Cmake never found gcc or g++.
Is it the case that Clang now only compiles with the Visual Studio tool set? I see in the “GettingStarted.rst” file that it only mentions Visual Studio in relation to the Windows operating system. I do find that slightly surprising if that is the case as Clang is claimed to be a “drop in replacement for GCC”. Although it does mention Cygwin there is no mention of MinGW and if I had Visual Studio why would I bother with Clang?
Is there any way to use the prebuilt version of Clang when tool sets are not installed in the directories that the Clang developers have chosen? I had imagined that there might be environment variables that would be allow different directories to be used but I can’t find any mention of these in the documentation.
I hope someone can suggest some way that the latest version of Clang can be used on Windows. If not, is there any version of Clang that runs on Windows?