Registry / utility / stb
library2024-07-29vcpkgunverified

Public domain header-only libraries for image loading, font rendering, and more.

vcpkg install stb
INSTALL
IMPORT
SIG · STB
S
stb
utilitycppv2024-07-29
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

stb_image.h
#include <stb_image.h>

Load an image using stb_image.

#define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #include <iostream> int main() { int width, height, channels; unsigned char* img = stbi_load("image.png", &width, &height, &channels, 0); if (img) { std::cout << "Loaded image: " << width << "x" << height << std::endl; stbi_image_free(img); } return 0; }
Debug
Known issues
gotchastb headers require defining the implementation macro (e.g., STB_IMAGE_IMPLEMENTATION) in exactly one source file.
fix
Define the macro before including the header in one .cpp file; include normally elsewhere.
affects: all
Upgrade
Version history
2024-07-29latest on vcpkg
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources

No resource links recorded.

stb — pip install stb · libregistry