EyeQ Docs

Building samples

Compile and run sample projects on your platform

This guide covers how to build the sample projects on Linux, macOS, and Windows. The build process is similar across all samples within each platform.

Linux and macOS

The Linux and macOS samples use makefiles for building. Each sample directory contains a makefile that compiles the sample and copies the required libraries and model files.

Prerequisites

Before building, ensure that you have the following installed:

  • GCC/G++ compiler (g++ 7.0 or later recommended)
  • pthread library
  • Standard development tools (make)
  • MacOS development requires Xcode and the command line tools

Build a sample

Navigate to the sample directory and run make.

cd Linux/SimpleAiSample
make

The makefile compiles the source code and copies all required files (libraries, model files, looks files) into the sample directory.

Run the sample

After building, run the executable directly.

./PerfectlyClear input.jpg output.jpg -v

Makefile structure

Each makefile follows this pattern below. There are path and complier options that are unique to each OS and architecture.

cc=g++
cflags=-O2 -pthread -D_LINUX -I../header -Wl,-R'$$ORIGIN/../bin'

all: PerfectlyClear

PerfectlyClear: SimpleAiSample.cpp
    ${cc} ${cflags} -m64 -o $@ SimpleAiSample.cpp \
        ../bin/libPerfectlyClearPro.a \
        ../bin/libPFCImageFile.a \
        ../bin/libwebp.a \
        ../bin/liblcms2.so.2 \
        ../bin/libexiv2.so.26 \
        -ldl
    # Copy required model files
    cp ../bin/*.pnn .
    cp ../bin/libPFCAIEngine.so .
    cp ../bin/libonnxruntime.so.1.5.1 .
    cp ../bin/v3.looks .

Required files

After building, these files must be in the same directory as the executable. Other supporting libraries or AI models might be needed for your specific implementation.

FilePurpose
libPFCAIEngine.*AI engine library
libonnxruntime.*ONNX runtime for AI models
pro_and_universal_*.pnnScene detection model
skintone_*.pnnSkin tone detection model
dynamic.pnnDynamic AI corrections model
aicolor.pnnAI white balance model
facemesh.pnn, faceshape.pnnFace mesh models
fdfront.pnn, fdback.pnnFace detection models
v3.looksLUT/Looks file

Windows (C++)

The Windows C++ samples use Visual Studio solution files (.sln) for building.

Prerequisites

Ensure that you have the following installed:

  • Visual Studio 2019 or later
  • Windows SDK

Build a sample

Follow the steps to build a sample:

  1. Open the solution file (SimpleAiSample.sln) in Visual Studio
  2. Select the Release configuration and x64 platform
  3. Build the solution (F7 or Build → Build Solution)

Output location

The compiled executable is placed in the project's output directory. Before running, copy the required DLLs and model files from Win/bin/x64/ to the executable directory.

Required files

Copy these files from Win/bin/x64/ to your output directory:

FilePurpose
PerfectlyClearPro.dllCore correction library
PFCImageFile.dllImage file helper library
PFCAIEngine.dllAI engine library
onnxrunt151.dllONNX runtime
exiv2.dllEXIF metadata library
*.pnnAI model files
v3.looksLUT/Looks file

For PDF processing, also include PFCPDF.dll and podofo.dll.

Windows (C# / .NET)

The C# samples include both .NET Framework and .NET Core projects.

.NET Framework samples

Build and copy the .NET sample files as follows:

  1. Open the solution file (e.g., CSharp_SimpleAiSample.sln) in Visual Studio
  2. Build the solution
  3. Copy required DLLs from Win/bin/x64/ to the output directory

.NET Core samples

The .NET Core samples include PreBuildEvent steps in the .csproj file that automatically copy required libraries.

<PropertyGroup>
  <PreBuildEvent>
    xcopy /C /E /Y /R ..\..\..\bin\x64\PerfectlyClearPro.dll .
    xcopy /C /E /Y /R ..\..\..\bin\x64\PerfectlyClearAdapter.dll .
    xcopy /C /E /Y /R ..\..\..\bin\x64\PFCImageFile.dll .
    xcopy /C /E /Y /R ..\..\..\bin\x64\exiv2.dll .
  </PreBuildEvent>
</PropertyGroup>

If you get build errors related to PreBuildEvent paths, then adjust the relative paths in the .csproj file. Some Visual Studio versions add an extra directory level, requiring one fewer ..\\ in each path.

Required .NET assemblies

Both .NET Framework and .NET Core projects require these assemblies:

FilePurpose
PerfectlyClearAdapter.dll.NET wrapper assembly
PerfectlyClearPro.dllCore correction library
PFCImageFile.dllImage file helper
PFCAIEngine.dllAI engine
*.pnnAI model files

License configuration

All samples require the SDK license path to be configured. You can either:

  1. Set the PFC_SDK_LICENSE environment variable
  2. Modify the source code to specify your license path

Set license path in C/C++:

// C/C++
int code = PFC_SetProtectionPath("/path/to/sdk_license");

Set license path in C#:

// C#
PerfectlyClear Pfc = new PerfectlyClear("C:\\path\\to\\sdk_license");

PFC-SDK Version 10.7.2.1269 built from 4fa849d8101945eea725a08dd0dae5101f090fa0 on 11-10-2025.

Copyright © 2026 EyeQ Imaging Inc. All rights reserved.

On this page