Installation
1. Download and install the Windows pre-built binary installer from this page: https://releases.llvm.org/download.html 2. If the installer asks for admin rights, select the PATH for all users option otherwise the installer will only adjust the PATH for the admin user and not the current user.
Alternative if you use the Do not add option.. option you will need to add the installation folder to the PATH after running the install.
To add adjust the PATH manually follow the instructions found here: https://www.zeusedit.com/phpBB3/viewtopic.php?t=6176
The folder that needs to be added to the PATH is as follows:
Code: Select all
C:\Program Files\LLVM\bin
From inside that command prompt type in this Clang command line:
Code: Select all
clang --version
Code: Select all
clang version 10.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
Code: Select all
'clang.exe' is not recognized as an internal or external command,
operable program or batch file.
Code: Select all
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world..." << endl;
return 0;
}
Code: Select all
cd c:\temp\
clang.exe test.cpp -o test.exe
dir test.exe
Running all of these commands should produce the following output:
Code: Select all
C:\temp>clang.exe test.cpp -o test.exe
C:\temp>dir test.exe
Volume in drive C is Windows
Volume Serial Number is 3690-9A91
Directory of C:\temp
28/05/2020 07:33 PM 245,760 test.exe
1 File(s) 245,760 bytes
0 Dir(s) 159,027,937,280 bytes free
Code: Select all
Hello world...
To run the compiler from inside the Zeus IDE you will need to make a configuration change to the C/C++ Document Type.
To make this change, use the Zeus Options, Document Types menu, edit the C/C++ Document Type and in the Compiler section define the compiler command line as:
Code: Select all
clang.exe "$fn" -o "$fdd$fb.exe"
To use this cofigure change open the test.cpp file and then use the Compiler, Compile menu to compile and link the file.
NOTE: The configuration above describes the installation of the 64 bit compiler. If the Microsoft C/C++ is also installed and located in the PATH then running the compile and link might result in this linker error:
Code: Select all
libcmt.lib(std_type_info_static.obj) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
clang: error: linker command failed with exit code 1112 (use -v to see invocation)
More details on the Clang command line options can be found here: https://clang.llvm.org/docs/ClangComman ... rence.html
Running the Executable for Inside Zeus
To make it easier to run the executable for inside Zeus, it comes with a macro that will try to run an executable that corresponds to the name of the currently active file.
By this, it is assumed the compiler configuration is setup to produce an executable in the same directory as the current document and the name the executable being created is using the base name (i.e.$fdd$fb.exe) of the document being compiled, as described earlier.
This allows Zeus to run the executable and capture it's output be using the Macros, Execute menu or the Macros, Execute tab found in the Navigator panel.
NOTE: If the executable runs but does not produce any output refer to the Mysteries of Clang post for details on how to fix this.
Setting up the Language Server
To setup the C/C++ language server follow the instructions found here: https://www.zeusedit.com/lsp/c_cpp.html
Cheers Jussi