Undefined reference to `ray::Init()'

Ray’s C++ API is not supported on Windows (including Cygwin), which is the root cause of your build and runtime errors. The official documentation and codebase state that the C++ API is experimental and only supported on Linux. Attempting to use it on Windows (even via Cygwin) will result in linker errors and segmentation faults, as you observed (source, source).

If you need to use Ray’s C++ API, you must use a Linux environment (native or via WSL2). There is no workaround for Windows at this time. Would you like more detail on setting up Ray C++ on Linux?

Sources:

Hint: Mention @RunLLM in the post for followups.