Using Zeus with Zig

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2495
Joined: Fri Aug 13, 2004 5:10 pm

Using Zeus with Zig

Post by jussij »

1. Go to the following download page an select from the various versions of Zig available: https://github.com/ziglang/zig/releases/

In this example the 0.5.0 version was installed from that release downloaded page.

2. Unzip the contents of that 0.5.0 package into this folder location.

Code: Select all

c:\zig-0.5.0\
NOTE: An alternative folder location can also be used. In addition if that folder location contains white space some extra care will be needed as the folder location will need to be wrapped in quotes. As such it is best to start with a folder location that does not contain white space.

3. Add the following folder location to the PATH environment variable:

Code: Select all

c:\zig-0.5.0\
More details about the PATH can be found here: http://www.zeusedit.com/phpBB3/viewtopic.php?f=5&t=6176

4. Start the Zeus IDE and check the PATH has been correctly configure by using the Tools, DOS Command Line menu to run the following command:

Code: Select all

zig version
Running that command should result in the following output:
0.5.0
If instead the following output is produced re-check the PATH settings as this output indicates the PATH setting is wrong:
'zig' is not recognized as an internal or external command, operable program or batch file.
5. Using the Options, Document Types menu edit the Zig Document Type and in the Compiler section enter in the following compiler command:

Code: Select all

zig build-exe "$fn"
6. Using the Zig documentation found here: https://ziglang.org/documentation/0.5.0/#Hello-World

Create a new test.zig file in the c:\temp folder using the following code:

Code: Select all

const std = @import("std");

pub fn main() !void {
    // If this program is run without stdout attached, exit with an error.
    const stdout_file = try std.io.getStdOut();
    // If this program encounters pipe failure when printing to stdout, exit
    // with an error.
    try stdout_file.write("Zig - Hello, world!\n");
}
7. With the test.zig file as the active window, use the Compiler, Compile menu to compile and link the code to produced an executable.

8. With the test.zig file as the active window, use the Macros, Execute 'test.exe' menu to run the executable file which should result in the following output:
Zig - Hello, world!
Cheers Jussi
Post Reply