Install Libvips and get the sample code working




Install Libvips


Start the compilation process. First download the source file and then follow compilation instruction.


$ tar xf vips-x.y.z.tar.gz
$ cd vips-x.y.z
$ ./configure


If you have permission issue, chmod +x configure as we need to make it executable.

$ make
$ sudo make install
$ sudo ldconfig



Install glib2-dev, pkg-config, build-essential, libexpat1-dev

sudo apt-get install  glib2-dev


Image format support


You might need libjpeg-dev, libp-dev and some other libraries that you required when u run configure.sh above.


If you do not install libraries above, you might get "jpg format is not supported".

Compiling the code

To compile this :- 

try running the following code :- 

pkg-config vips-cpp --cflags --libs`

It will generate something like this :- 

-pthread -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -L/usr/local/lib -lvips-cpp -lvips -lgobject-2.0 -lglib-2.0



Then all you need to do is append it to g++ -g -Wall example.cc


Final compilation are shown here :- 


 g++ -g -Wall example.cc -pthread -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -L/usr/local/lib -lvips-cpp -lvips -lgobject-2.0 -lglib-2.0










Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm