This post describes a step by step procedure to compile and run qrencode, a command line tool for encoding text into png files of QRcodes written by FUKUCHI Kentaro as part of libqrencode (licensed under LGPL).
1/ Create a directory for our project
2/ Download the libqrencode source, and untar it.
3/ We need to set a couple of environment variables to tell configure where the libpng libraries and headers are:
4/ Even though we don't need pkg-config (that's why we exported vars in step 3), configure requires a pkg-config script, so we'll create an empty one and add it to the path.
5/ Now we have everything we need, so we can run ./configure
6/ Once configure runs, we can run make to build it
7/ And finally we get to encode a qr code:
The end result:
1/ Create a directory for our project
cristi:~ diciu$ mkdir qr
cristi:~ diciu$ cd qr/
2/ Download the libqrencode source, and untar it.
cristi:qr diciu$ tar zxvf qrencode-3.1.0.tar.gz
cristi:qr diciu$ cd qrencode-3.1.0
3/ We need to set a couple of environment variables to tell configure where the libpng libraries and headers are:
cristi:qrencode-3.1.0 diciu$export png_CFLAGS="-I /usr/X11/include/"
cristi:qrencode-3.1.0 diciu$export png_LIBS="-lpng -L/usr/X11/lib/"
4/ Even though we don't need pkg-config (that's why we exported vars in step 3), configure requires a pkg-config script, so we'll create an empty one and add it to the path.
cristi:qrencode-3.1.0 diciu$ touch pkg-config
cristi:qrencode-3.1.0 diciu$ chmod +x pkg-config
cristi:qrencode-3.1.0 diciu$ export PATH=$PATH:.
5/ Now we have everything we need, so we can run ./configure
./configure
6/ Once configure runs, we can run make to build it
make
7/ And finally we get to encode a qr code:
./qrencode -o ~/Desktop/modulo.png "http://www.modulo.ro"
The end result: