External Library Bindings

FreeBASIC includes many `.bi` files that let BASIC programs call libraries written in C or other languages. These pages describe the bindings and the examples that use them.

A binding is not the same thing as a complete package. The include file can describe the API, but the target system still needs the matching library, import library, shared object, DLL, framework, package, or runtime asset. This matters more now because the compiler is being used on a much wider set of targets than the old desktop-only cases.

How to read this page

Usually practical | The binding is commonly usable when the normal operating system package is installed, or when this build already ships the needed pieces.
Optional external library | The examples are valid, but the library is not part of every FreeBASIC install. Install the development package for your operating system before expecting the example to link.
Legacy or special-case | The binding exists, but the upstream library is old, commercial, uncommon, or not packaged cleanly on every target.
Platform API | The binding is only meaningful on the platform that owns the API. A Windows API example is not expected to work on JavaScript, Android, Xbox, DOS, or Unix targets.

Platform reality from the example sweeps

The examples directory contains notes from current example sweeps. Those notes are a useful reality check for this table.

Windows win32 | The shipped example set links a large number of examples. Some old or commercial libraries still need extra runtime DLLs or import libraries before the examples are truly runnable.
Windows win64 | Many restored examples are now practical, including several database, image, helper, and math examples. The remaining rough edges are mostly older libraries such as Allegro 4, CGUI, GRX, wx-c, BASS/BASSMOD, FMOD 3, PDFlib, Newton, and old SpiderMonkey.
Cygwin | The core compiler, runtime, networking, procedure, and thread examples are healthy. Most external-library failures are plain missing-library failures, not compiler failures.
JavaScript, Android, and Xbox | These targets are useful compile targets for portable BASIC code, but most desktop external libraries and OS APIs are not expected to exist there. Treat those examples as target-specific unless the target package says otherwise.

Sound and media

sfxlib command set | Built-in BASIC-oriented sound commands. Start here for SOUND, PLAY, SFX, MUSIC, MIDI, waveform, envelope, channel, panning, and capture commands.
OpenAL | 3D audio API. Optional on most systems.
BASS and BASSMOD | Third-party audio libraries. Useful when you provide the vendor runtime, but not something every FreeBASIC package can ship.
FMOD | Old FMOD binding. Treat this as legacy unless you already have the matching SDK/runtime.
Flite | Speech synthesis library.
mpg123, Ogg, Vorbis, and sndfile | Audio decoding and file-format libraries.
PortAudio | Cross-platform audio I/O library.
VLC | Media playback through libVLC.
old sfx binding page | Historical page kept for compatibility. New code should normally read the sfxlib command pages instead.

Graphics, image, and display libraries

Allegro, SDL, TinyPTC, DUGL, and GRX | Game, framebuffer, and graphics libraries. Several are useful for old examples, but some are legacy on modern Windows packages.
OpenGL, GLUT, freeglut, and GLFW | OpenGL-related bindings. Good desktop targets, but not generally expected on JavaScript, Android, Xbox, or DOS package installs.
Cairo, caca, DISLIN, and PDFLib | Drawing, terminal graphics, plotting, and document-generation libraries.
DevIL, FreeImage, FreeType2, GD, GIFLIB, jpeglib, jpgalleg, and libpng | Image loading, image writing, font, and raster helpers. These are often practical when the OS package manager provides matching development libraries.

GUI and platform user-interface libraries

CGUI, GTK+, IUP, JAPI, and wx-c | GUI bindings. Some are useful, but they are among the bindings most likely to need extra runtime libraries.
Curses | Terminal UI support.
X11 and Windows API | Platform APIs. These are not portable abstractions.

Data, database, and web libraries

GDBM, MySQL, PostgreSQL, and SQLite | Database bindings. SQLite is usually the easiest dependency to satisfy; client/server databases need the matching client development package.
CGI utility, FastCGI, curl, and ZeroMQ | Web, HTTP, and messaging support. These are practical where the OS provides the libraries, but they are not automatically available on every cross target.
Expat, libxml, libxslt, and mxml | XML parsers and transformation libraries.
json-c | JSON support through json-c.

Development, language, and helper libraries

ASpell, BFD, CUnit, GDSL, gettext, MediaInfo, and UUID | Helper and developer libraries. These are useful, but mostly depend on optional OS packages.
libffi, libjit, JNI, Lua, and SpiderMonkey | Language runtimes and foreign-function interfaces. libjit and old SpiderMonkey are special-case bindings on current Windows package builds.

Math, physics, compression, regex, and system APIs

big_int, GMP, and GSL | Big-number and scientific/math libraries.
Chipmunk, Newton, and ODE | Physics libraries. Expect package availability to vary by platform.
cryptlib | Cryptography library binding. Treat licensing and redistributability as part of the dependency decision.
bzip2, LZMA, LZO, QuickLZ, Zip, and zlib | Compression libraries.
PCRE and TRE | Regular-expression libraries.
C runtime, DOS API, DispHelper, and GLib | System/runtime bindings. These should be read with the target platform in mind.

Practical advice

If an external-library example fails to build, first check whether the target system has the library development package installed. Missing `-l` errors usually mean the compiler is fine and the library is absent. Runtime DLL errors on Windows usually mean the program linked, but the needed DLL was not next to the executable or on `PATH`.

For new portable programs, prefer the built-in FreeBASIC runtime, gfxlib, sfxlib, sockets, and standard file/string functionality before reaching for a third-party binding. Use external libraries when they give you a real feature you need, and document that dependency in your own project.