{"id":60169,"library":"stb","title":"stb","description":"Public domain header-only libraries for image loading, font rendering, and more.","status":"active","version":"2024-07-29","language":"cpp","source_language":null,"source_url":null,"tags":["header-only","image","font","utility"],"install":[{"cmd":"vcpkg install stb","lang":"bash","label":"vcpkg"},{"cmd":"# CMakeLists.txt\nfind_package(stb CONFIG REQUIRED)\ntarget_link_libraries(main PRIVATE stb::stb)","lang":"cmake","label":"CMake"}],"dependencies":[],"imports":[{"symbol":"stb_image.h","correct":"#include <stb_image.h>"}],"quickstart":{"code":"#define STB_IMAGE_IMPLEMENTATION\n#include \"stb_image.h\"\n#include <iostream>\n\nint main() {\n    int width, height, channels;\n    unsigned char* img = stbi_load(\"image.png\", &width, &height, &channels, 0);\n    if (img) {\n        std::cout << \"Loaded image: \" << width << \"x\" << height << std::endl;\n        stbi_image_free(img);\n    }\n    return 0;\n}","lang":"cpp","description":"Load an image using stb_image."},"warnings":[{"fix":"Define the macro before including the header in one .cpp file; include normally elsewhere.","message":"stb headers require defining the implementation macro (e.g., STB_IMAGE_IMPLEMENTATION) in exactly one source file.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'domain':3 'font':11,19 'header':5,16 'header-on':4,15 'imag':9,18 'librari':7 'load':10 'public':2 'render':12 'stb':1 'util':20","created_at":"2026-06-16T19:19:17.847843+00:00","updated_at":"2026-06-16T19:19:17.847843+00:00","problems":[],"ecosystem":"vcpkg","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}