LWXGL ships as a single Makefile project with no generated build system or external dependency manager. RunningDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Dressedalarm184/lwxgl/llms.txt
Use this file to discover all available pages before exploring further.
make build in the repository root invokes g++ with -fPIC -shared to produce libLWXGL.so. Running make install (as root) copies the shared object to /usr/local/lib and the public header libLWXGL.h to /usr/local/include, then calls ldconfig to register the library with the dynamic linker. The entire install footprint is two files.
Prerequisites
Make sure the following are present on your system before building:g++— the GNU C++ compiler (the library source is C++ internally, even though it exposes a C API)libx11-dev— X11 client-library development headers (X11/Xlib.h,X11/Xutil.h,X11/XKBlib.h)make— GNU Make to drive the provided Makefile- An X11 display server — required at runtime; not needed to compile the library itself
Makefile Targets
The Makefile defines exactly two targets:make build compiles src/main.cc (which #includes the remaining .cc source files as translation-unit includes) into a position-independent shared object at libLWXGL.so in the repository root. The -fvisibility=hidden flag ensures that only symbols explicitly marked with __attribute__((visibility("default"))) — every G-prefixed API function — are exported; all internal symbols remain hidden.
make install copies the compiled library and header to their system destinations and runs ldconfig so the dynamic linker cache is updated immediately. This target embeds sudo in its recipe, so you will be prompted for your password when invoking it directly with make install.
Full Build and Install Sequence
sudo make install completes, ldconfig will have registered /usr/local/lib/libLWXGL.so and any program linked with -lLWXGL will resolve the library at runtime without further configuration.
Linking Your Project
Once LWXGL is installed, compile any C or C++ source file against it by adding-lLWXGL -lX11 to your compiler invocation:
-I or -L flags are needed when the library was installed to the standard /usr/local prefix, because both gcc and g++ search /usr/local/include for headers and /usr/local/lib for libraries by default.
libLWXGL.h wraps all of its declarations in an extern "C" block guarded by #ifdef __cplusplus. This means the header is safe to #include from both C and C++ translation units without any name-mangling issues. You do not need a separate C++ wrapper — just #include <libLWXGL.h> directly in .c and .cpp files alike.Uninstalling
LWXGL does not provide anuninstall Makefile target. To remove it manually, delete the two installed files and refresh the linker cache: