To get more up to date compiler, a better option would be using MSYS2 to install these compilers as described here: viewtopic.php?t=8303
Another option is to download the compiler packages found here: https://winlibs.com/
For example, the GCC 13.2.0 UCRT Runtime package downloaded from that page reports with the following GCC version:
Code: Select all
c:\mingw32\bin>gcc.exe --version
gcc.exe (MinGW-W64 i686-ucrt-posix-dwarf, built by Brecht Sanders, r5) 13.2.0
Copyright (C) 2023 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.
The steps below describe how to get the MinGW C/C++ compiler up and running on Windows.
Step 1) Visit the MinGW - Minimalist GNU for Windows page to download the MinGW installer software. The file to download is the mingw-get-setup.exe which is attached to the green download button found on that page.
Step 2) Run that installer downloaded from the above step:
Code: Select all
c:\temp\mingw-get-setup.exe
a. Select the packages to be installed by right clicking on the item and marking it for installation.
NOTE: At a minimum select the mingw32-base (C compiler) and mingw32-gcc-g++ (C++ compilers) package options or alternatively select all the packages as shown in the image above.
b. To install the selected packages, use the Installation, Apply Changes menu and hit the Apply button in the resulting dialog as shown below: Step 3) When running the installation using the wizard take note of the install folder used. Lets assume the install folder used as shown below:
Code: Select all
C:\Program Files (x86)\mingw32\
IMPORTANT: Take extreme care when editing this PATH environment variable. Only add to it. Never delete from it. More details about the PATH can be found here: http://www.zeusedit.com/phpBB3/viewtopic.php?f=5&t=6176
For the installation folder noted earlier, this bin folder will need to be added to the PATH:
Code: Select all
C:\Program Files\mingw32\bin
Code: Select all
C:\mingw32\
Code: Select all
C:\mingw32\bin
In the steps that follow it is assumed the GNU C++ compiler is being used, but if the GNU C compiler is required, just replace the g++.exe command with the gcc.exe command.
Step 4) Test the PATH settings using the Windows Start Button and run the cmd executable to bring up a command prompt.
From inside that command prompt type in this C++ compiler command line:
Code: Select all
g++.exe --version
Code: Select all
g++ (MinGW.org GCC Build-20200227-1) 9.2.0
Copyright (C) 2019 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.
Code: Select all
gcc.exe --version
Step 5)
Test the compiler by creating a simple c:\temp\test.cpp test file using the C++ code shown below:
Code: Select all
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world..." << endl;
return 0;
}
Code: Select all
cd c:\temp\
g++.exe test.cpp -o test.exe
dir test.exe
Running those commands should produce the following output:
Code: Select all
c:\>cd c:\temp\
c:\Temp>g++.exe test.cpp -o test.exe
c:\Temp>dir test.exe
Volume in drive D is DATA
Volume Serial Number is 06EC-1105
Directory of c:\Temp
21/05/2016 02:30 PM 2,707,662 test.exe
1 File(s) 2,707,662 bytes
0 Dir(s) 1,824,970,645,504 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
g++.exe "$fn" -o "$fdd$fb.exe"
NOTE: The options above are for the GNU C++ compiler. To use the GNU C compiler you need to use the gcc.exe and set the options for that compiler. More details on options for the GNU C compiler refer to this link.
If you only want to syntax check the current file change the command line to be this:
Code: Select all
g++.exe -c "$fn"
Code: Select all
g++.exe -x c++ -Wall -std=c++11 "$fn" -o "$fdd$fb.exe"
Code: Select all
g++.exe -x c -Wall -std=c90 "$fn" -o "$fdd$fb.exe"
Code: Select all
g++.exe --help
Code: Select all
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world..." << endl;
return 0;
}
This will produce a c:\temp\test.exe and again use the DOS Command Line menu to run the executable and you should see this output:
Code: Select all
Hello world...
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 MinGW 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