- First of all you need either Clang64 or MinGW64 MSYS2 environment
- You will probably need to install llvm and cmake:
pacman -S install llvm cmake
- c3c: https://github.com/kvk1920/c3c
git clone https://github.com/kvk1920/c3c c3c_win_test
cd c3c_win_test
git checkout windows_compatibility
mkdir cmake-build
cd cmake-build
cmake .. -G "MinGW Makefiles"
cmake --build .
- After that create file main.c3 with the following content:
module hello_world;
import std::io;
func void main()
{
io::printf("Hello, world!\n");
}
./c3c.exe compile main3.c --target x64_mingw
- this fails with some linker errors, but object file hello_world.o
should be created.
- Now you can just run
clang hello_world.o
to link against necessary system libs and startup files.