Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
  1. First of all you need either Clang64 or MinGW64 MSYS2 environment
  2. You will probably need to install llvm and cmake: pacman -S install llvm cmake
  3. 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 .
  1. After that create file main.c3 with the following content:
module hello_world;
import std::io;

func void main()
{
   io::printf("Hello, world!\n");
}
  1. ./c3c.exe compile main3.c --target x64_mingw - this fails with some linker errors, but object file hello_world.o should be created.
  2. Now you can just run clang hello_world.o to link against necessary system libs and startup files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment