Running C++ in Zerethon IDE
How Run compiles your project with g++, the flags it uses, the time limit, input and tests.
Runs in Zerethon IDE · C++ (GCC 14)
Official C++ documentation ↗
- Run (Ctrl/⌘+Enter) compiles the entry —
main.cppby default — with the project's other sources:g++ -std=gnu++20 -O1 -Wall -Wextra …, then runs the program. Make another file the entry with the ▶ button next to it in the explorer. - A compile or link error stops the run with “Compilation failed · nothing was run”; warnings are shown but do not stop it.
- A run is stopped after 20 seconds (compiling included — g++ needs a few seconds). Memory is limited, there is no network, and project files are read-only (write to
/tmp). - Run tests (Ctrl/⌘+Shift+Enter) builds and runs every
test_*.cppprogram (each linked with the other sources). A test passes when it exits with 0.
test_geometry.cpp
#include <cassert>
#include <iostream>
#include "geometry.hpp"
int main() {
assert(geometry::area(2, 3) == 6);
std::cout << "geometry ok\n";
}
geometry.cpp from “Header files and several sources”.