Docs/Optional libraries
Guide

Optional libraries

DominScript runs with nothing but the folder you downloaded. A few plugins — graphics, video, TLS, SQLite — use well-known third-party libraries while a script runs, and those are not in the download. This page is what to do when a script tells you one is missing.

runtime/shipped empty, with a READMEneeded by sdl2, sdl2_image, sdl2_ttf, opengl, ffmpeg, tls, sqlite, mysql, postgres, json

The message is the instruction

Nothing in DominScript has to be set up in advance. If a script uses a plugin whose library is not on your machine, the plugin stops and says what it needs — the file by name, and the folder to put it in, as a real path on your disk:

sdl2.Init: SDL2 not found. Install it, or copy SDL2.dll into C:\DominScript\runtime

That folder, runtime, is inside the DominScript folder you unpacked, and it is empty when you get it. Either install the library the way your system normally does, or download it and copy the named file into runtime. Run the script again; that is all. The same rule holds on Windows and Linux, for every plugin.

Which plugin needs what

PluginLibraryWindows fileLinux file
sdl2SDL2 — windows, input, audio, 2D drawingSDL2.dlllibSDL2-2.0.so.0
sdl2_imageSDL2_image — PNG / JPG / WebP / TIFF decoded into a pixel packet (and SDL2 for its surfaces)SDL2_image.dlllibSDL2_image-2.0.so.0
sdl2_ttfSDL2_ttf — TrueType text rendered into a pixel packet; brings FreeType along (and SDL2 for its surfaces). Fonts are not shipped: the script names a system font file or its ownSDL2_ttf.dlllibSDL2_ttf-2.0.so.0
openglSDL2 for the window and context; OpenGL itself comes with the OSSDL2.dlllibSDL2-2.0.so.0
ffmpegFFmpeg — decoding video and audioavutil-NN.dll, swresample-N.dll, avcodec-NN.dll, avformat-NN.dll, swscale-N.dlllibavutil.so.NN, libswresample.so.N, libavcodec.so.NN, libavformat.so.NN, libswscale.so.N
tlsOpenSSL 3 — HTTPS and TLS socketslibssl-3-x64.dll, libcrypto-3-x64.dlllibssl.so.3, libcrypto.so.3
sqliteSQLite 3sqlite3.dlllibsqlite3.so.0

The other official plugins need nothing. The spinning-cube demo on the front page (opengl_ffmpeg_script_driven_demo.dom) needs SDL2, SDL2_image and FFmpeg; the 2D sdl2_demo.dom needs SDL2 and SDL2_image; both cube demos now take their logo through SDL2_image as well.

Where to get them

  • SDL2, SDL2_image and SDL2_ttf. The release pages at github.com/libsdl-org/SDL, github.com/libsdl-org/SDL_image and github.com/libsdl-org/SDL_ttf; on Windows the win32-x64 zip of each holds the single DLL. On Linux: apt install libsdl2-2.0-0 libsdl2-image-2.0-0 libsdl2-ttf-2.0-0 (or your distribution’s equivalent). No font comes with any of them or with DominScript: a script opens a font file of the system (/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf, C:\Windows\Fonts\arial.ttf) or its own.
  • FFmpeg. ffmpeg.org/download.html; on Windows take a shared build — its bin folder holds the DLLs, copy the five named above. On Linux: apt install ffmpeg.
  • OpenSSL 3. On Linux it is almost always present already. On Windows, a binary installer or the two DLLs from a build; openssl.org links to both.
  • SQLite 3. On Linux, present on practically every system. On Windows, sqlite.org/download.html → “Precompiled Binaries for Windows” → the sqlite-dll-win-x64 zip.

How DominScript searches

Every plugin looks in the same three places, in this order, and takes the first hit — at load time, in its init hook (see how plugins start and stop), so a missing library stops the script before it starts:

  1. the runtime folder inside the DominScript folder (or the folder named by DOMIN_RUNTIME_DIR in the environment, if you set one);
  2. a developer-tree location, 3rd_party/<library>/<platform>, which a downloaded DominScript does not have;
  3. wherever the operating system itself would find the library — a system install, the folder domin is in, PATH on Windows, the library directories on Linux.

Because runtime comes first, a copy there also wins over an older system version, should you ever need that.

Three rules

  • Match the bit-width. A 64-bit domin.exe needs 64-bit DLLs. A mismatch does not warn; it simply fails to load, and the message above appears.
  • Keep the license next to the file. Each of these libraries permits being copied this way; each asks that its LICENSE (and NOTICE, where it has one) travel with it. Put them in runtime beside the file.
  • Prefer the system’s copy. A library in runtime does not get your operating system’s security updates. Use the folder when the system has no copy, not instead of one.