compat.libpng
#includePNG reference library — portable PNG encode/decode (depends on zlib)
#include "png.h"
mcpp add compat.libpng@1.6.43
Usage
From this repository's own test project — built and run by CI, not written for the website.
// Smoke test — verify compat.libpng builds, links, and basic API works
#include "png.h"
import std;
int main() {
auto* png = png_create_read_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
if (!png) return 1;
auto* info = png_create_info_struct(png);
if (!info) { png_destroy_read_struct(&png, nullptr, nullptr); return 2; }
std::println("compat.libpng smoke test: ok");
png_destroy_read_struct(&png, &info, nullptr);
return 0;
}
tests/examples/libpng/tests/read.cpp · project tests/examples/libpng
Build
- targets
libpng (lib)- language
c++23- C standard
c99- import std
- no
- include dirs
*, mcpp_generated
Sources (15)
*/png.c*/pngerror.c*/pngget.c*/pngmem.c*/pngpread.c*/pngread.c*/pngrio.c*/pngrtran.c*/pngrutil.c*/pngset.c*/pngtrans.c*/pngwio.c*/pngwrite.c*/pngwtran.c*/pngwutil.c
Generated files
mcpp_generated/pnglibconf.h
Versions
| Version | Platforms | Mirrors | sha256 |
|---|---|---|---|
1.6.43 latest |
LinuxWindowsmacOS | source | fecc95b46cf0… |