Skip to content

Latest commit

 

History

History
89 lines (61 loc) · 2.23 KB

File metadata and controls

89 lines (61 loc) · 2.23 KB

Building FastRobot 🛠️

Complete build guide for compiling the native C++ Win32 SendInput and DirectX capture engine and packaging the Java JAR.


Prerequisites

  • Windows 10 or 11 (64-bit)
  • JDK 17+ (Eclipse Adoptium or Oracle JDK)
  • Visual Studio 2022 or 2026 (Community, Professional, or Enterprise) with "Desktop development with C++" workload
  • Windows 10/11 SDK (installed with Visual Studio)
  • Maven 3.9+

Automated One-Click Build

FastRobot includes an automated compilation script with Visual Studio and JDK discovery:

# In the FastRobot repository root:
compile.bat

What compile.bat does automatically:

  1. Detects Visual Studio 2026 / 2022 Community via vswhere.exe.
  2. Initializes the 64-bit developer environment (vcvars64.bat).
  3. Compiles native/fastrobot.cpp and native/DXGICapture.cpp with /O2 and links Win32 user/GDI and DirectX libraries.
  4. Deploys fastrobot.dll directly to:
    • build/fastrobot.dll
    • src/main/resources/native/fastrobot.dll
    • %USERPROFILE%\.fastcore\native\fastrobot\fastrobot.dll

Maven Java Packaging

mvn clean install -DskipTests

JMH Benchmarking

To build and execute the official JMH benchmark suite:

run-benchmark.bat

Build Commands

Command Purpose
compile.bat Build native DLL (requires Visual Studio)
mvn clean compile Compile Java only
mvn clean package Build JAR with DLL
mvn clean package -DskipTests Fast build

Running Examples

All examples are in examples/00-basic-usage/:

cd examples/00-basic-usage
mvn compile exec:java

Native Code Structure

native/
├── fastrobot.cpp           # Main JNI implementation
├── fastrobot.h             # JNI header
├── DXGICapture.cpp         # DirectX capture
└── DXGICapture.h           # DirectX header

Troubleshooting

"Cannot find cl.exe" — Run in "Developer Command Prompt for VS 2019/2022"

"UnsatisfiedLinkError: no fastrobot in java.library.path" — Run compile.bat first

"DXGI_ERROR_NOT_FOUND" — Ensure Windows 10/11 with DirectX 11+ GPU