Use the following wsl.exe command to check a Linux distribution has been installed and is set as active:
Code: Select all
wsl.exe --list
Code: Select all
Windows Subsystem for Linux Distributions:
Ubuntu-24.04 (Default)
docker-desktop
docker-desktop-data
Code: Select all
wsl -s Ubuntu-24.04
Code: Select all
sudo apt update
Code: Select all
sudo apt install build-essential
4. Optionally you can install the manual pages for these tools using this command:
Code: Select all
sudo apt-get install manpages-dev
Code: Select all
gcc --version
Code: Select all
gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.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
g++ --version
Code: Select all
g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.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 Zeus compiler and tool configurations have an option to run the command using Bash. This equates to running the compiler or tool from inside the Linux subsystem.
This means you can run the Linux compilers inside Zeus and have the output captured in the editor.
For example, the image below shows the compiler settings required: The compiler command line used is as follows:
Code: Select all
g++ "$f" -g -o "$fb"
Testing the Zeus Compiler Setup
Consider a test.cpp that contains the following code:
Code: Select all
#include <iostream>
int main(int argc, char *argv[])
{
std::cout << "Hello World!" << std::endl << std::endl;
for (int i = 0; i < argc; ++i)
{
std::cout << "Argument: " << i << " => " << argv[i] << std::endl;
}
return 0;
}
Code: Select all
C:\Projects\c++\test.cpp
Code: Select all
/mnt/c/Projects/c++/test.cpp
Code: Select all
test test.cpp
Code: Select all
./test
Code: Select all
Hello World!
Argument: 0 => ./test