diff --git a/doc/using-C.xml b/doc/using-C.xml index e6c3e4c4..ab43f2a6 100644 --- a/doc/using-C.xml +++ b/doc/using-C.xml @@ -186,19 +186,41 @@ operation flags: sequential-unbuffered linkend="libvips-error">VIPS Error to find out how to get and clear the error log. + Example + + On *nix systems, you can compile the example code with something like: + + +$ gcc -g -Wall myprog.c `pkg-config vips --cflags --libs` + + + On Windows, you'll need to set the compiler flags by hand, perhaps: + + +x86_64-w64-mingw32-gcc-win32 -mms-bitfields \ + -Ic:/vips-8.6/include \ + -Ic:/vips-8.6/include/glib-2.0 \ + -Ic:/vips-8.6/lib/glib-2.0/include \ + myprog.c \ + -Lc:/vips-8.6/lib \ + -lvips -lz -ljpeg -lstdc++ -lxml2 -lfftw3 -lm -lMagickWand -llcms2 \ + -lopenslide -lcfitsio -lpangoft2-1.0 -ltiff -lpng14 -lexif \ + -lMagickCore -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 \ + -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl \ + -o myprog.exe + + + + VIPS from C example -/* compile with: - * - * gcc -g -Wall try211.c `pkg-config vips --cflags --libs` - */ - #include <stdio.h> #include <vips/vips.h>