Here is what I did:
- Download http://www.leptonica.com/source/leptonlib-1.67.tar.gz
- Extract it to
/home/misha/src ./configure; make- copy
prog/colorquant_reg.c to /home/misha/Desktop/stackoverflow - if desired, edit
/home/misha/Desktop/stackoverflow/colorquant_reg.c as you wish - this is no longer part of the library. Therefore, I assume that here you can add your new headers, etc.
Then, from /home/misha/Desktop/stackoverflow , I can compile the file using the following command:
export LIBLEPT=/home/misha/src/leptonlib-1.67/ gcc colorquant_reg.c -I$LIBLEPT/src -L$LIBLEPT/src/.libs -llept -o colorquant_reg.out
The first line is for convenience only - now we can use $LIBLEPT to indicate a long path. The second line is what compilation does:
-I tells the compiler where to look for included files-L tells the compiler where to look for library files (for the linker)-llept tells the linker the link with leptonica (it will look for liblept.so-o indicates the output file, which is now located in ~/Desktop/stackoverflow/colorquant_reg.out
source share