How to reproduce:
1. Open the project “IN-112335_StaticLibIssue”
2. File → Build and Run
3. Observe the result
Expected result: The standalone build opens without any errors
Actual result: Error window appears with the message “Failed to load il2cpp”
Reproducible with: 2023.1.0a1, 6000.0.56f1, 6000.2.1f1, 6000.3.0a5 (36d7e9fd6645)
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- The project builds without errors, but the error appears when the standalone build is launched
- No Player.log is created
- The project uses --linker-flags-file for some static libraries
- Prerequisites:
- In the Unity project, Edit → Project Settings → Player → Other Settings → Configuration
- Scripting Backend → IL2CPP
- C++ Compiler Configuration → Release
- Under Script Compilation → Scripting Define Symbols → add “EADPUNITY_USE_STATIC_LIB”
- The issue also reproduces when running the solution file (.sln), to run the file in Visual Studio 2022:
- File → Build Profiles → Create Visual Studio Solution
- Click Build
- Open Visual Studio 2022 → Open a project or solution → select the .sln file in the build directory
- Build the project with the x64 configuration