What Compile & Load actually runs — the bundled clang++ invocation, the exact flags, where the .dll lands, and how to read compiler output.
When you press Compile & Load the terminal runs the bundled C++ compiler on your source, in the background, and hot-loads the result. You never touch a command line — but it helps to know exactly what happens, because that is what the OUTPUT pane is showing you.
The compiler invocation is, in full:
clang++ is the bundled toolchain (a trimmed LLVM/Clang MinGW build shipped inside the app). It is run directly — no shell, no Visual Studio environment, no vcvars — with each argument passed verbatim.
-shared | Build a DLL (not an executable) — the loadable study plugin. |
-static | Statically embed the C++ runtime (libc++ / libunwind) so the DLL has no external runtime dependency and loads cleanly in the terminal. Required. |
-O2 | Optimize. Studies run on the chart thread every recompute, so speed matters. |
-std=c++20 | The language standard the SDK and examples target. |
-I <AppDir>\sdk | The SDK include directory that holds sharpnel_study_sdk.h. Overridable with SHARPNEL_SDK_DIR. |
-o …\_session\<name>__hN.dll | The output DLL, with a session-unique suffix (see below). |
Builds go under the terminal's studies folder (your app-data studies directory, or SHARPNEL_STUDIES_DIR if set). The study name is sanitized to a filesystem- and identifier-safe base first (non-alphanumeric characters become underscores).
src/<name>/<name>.cpp | Your exact source, re-saved on every compile — always editable and recoverable. |
_session/<name>__hN.dll | The freshly built DLL. The suffix increments each compile so a re-build never collides with a copy already mapped into the running process (a loaded DLL locks its file on Windows). |
<name>.dll.pending | A staged copy the loader promotes to <name>.dll at the next startup, before any study DLL is mapped — so your study auto-loads next launch. |
The OUTPUT pane shows the compiler's standard output and standard error merged together, followed by the load result:
Compiled OK., then the green ✓ Loaded study '<id>' — added to Add Study.✗ Build failed. Nothing is loaded. Fix and press again.✗ Built, but load failed: … with the reason.A compile is asynchronous and one-at-a-time: the button disables while a build is running and re-enables when it finishes.
The Study Editor is the supported path and needs no setup. If you would rather build a DLL yourself and drop it in, the terminal will still load it: place the compiled .dll in the studies folder and approve it from Custom Studies › Manage Plugins….
sharpnel_study_sdk.h. The bundled editor builds with clang++ -static as above; if you use a different toolchain, embed its runtime the same way so the DLL has no external runtime dependency.