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 practicalThe binding is commonly usable when the normal operating system package is installed, or when this build already ships the needed pieces.
Optional external libraryThe 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-caseThe binding exists, but the upstream library is old, commercial, uncommon, or not packaged cleanly on every target.
Platform APIThe 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 win32The 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 win64Many 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.
CygwinThe 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 XboxThese 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 setBuilt-in BASIC-oriented sound commands. Start here for SOUND, PLAY, SFX, MUSIC, MIDI, waveform, envelope, channel, panning, and capture commands.
OpenAL3D audio API. Optional on most systems.
BASS and BASSMODThird-party audio libraries. Useful when you provide the vendor runtime, but not something every FreeBASIC package can ship.
FMODOld FMOD binding. Treat this as legacy unless you already have the matching SDK/runtime.
FliteSpeech synthesis library.
mpg123, Ogg, Vorbis, and sndfileAudio decoding and file-format libraries.
PortAudioCross-platform audio I/O library.
VLCMedia playback through libVLC.
old sfx binding pageHistorical page kept for compatibility. New code should normally read the sfxlib command pages instead.

Graphics, image, and display libraries

Allegro, SDL, TinyPTC, DUGL, and GRXGame, framebuffer, and graphics libraries. Several are useful for old examples, but some are legacy on modern Windows packages.
OpenGL, GLUT, freeglut, and GLFWOpenGL-related bindings. Good desktop targets, but not generally expected on JavaScript, Android, Xbox, or DOS package installs.
Cairo, caca, DISLIN, and PDFLibDrawing, terminal graphics, plotting, and document-generation libraries.
DevIL, FreeImage, FreeType2, GD, GIFLIB, jpeglib, jpgalleg, and libpngImage 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-cGUI bindings. Some are useful, but they are among the bindings most likely to need extra runtime libraries.
CursesTerminal UI support.
X11 and Windows APIPlatform APIs. These are not portable abstractions.

Data, database, and web libraries

GDBM, MySQL, PostgreSQL, and SQLiteDatabase bindings. SQLite is usually the easiest dependency to satisfy; client/server databases need the matching client development package.
CGI utility, FastCGI, curl, and ZeroMQWeb, 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 mxmlXML parsers and transformation libraries.
json-cJSON support through json-c.

Development, language, and helper libraries

ASpell, BFD, CUnit, GDSL, gettext, MediaInfo, and UUIDHelper and developer libraries. These are useful, but mostly depend on optional OS packages.
libffi, libjit, JNI, Lua, and SpiderMonkeyLanguage 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 GSLBig-number and scientific/math libraries.
Chipmunk, Newton, and ODEPhysics libraries. Expect package availability to vary by platform.
cryptlibCryptography library binding. Treat licensing and redistributability as part of the dependency decision.
bzip2, LZMA, LZO, QuickLZ, Zip, and zlibCompression libraries.
PCRE and TRERegular-expression libraries.
C runtime, DOS API, DispHelper, and GLibSystem/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.