title: Tesseract running local Makefile - pkgconfig: Permission denied
body: <p>I have no problem to run Tesseract with Leptonica as administrator. But have small problem with running Tesseract wihout admin rights - locally. </p>
  
  <p>Makefile looks like:</p>
  
  <pre><code>CC=g++
  CFLAGS+=`pkg-config --cflags opencv`
  LDFLAGS+=`pkg-config --libs opencv`
  TSFLAGS+=`$(HOME)/local/lib/pkgconfig --libs $(HOME)/local/tesseract`
  
  PROG=exp
  
  .PHONY: all clean
  $(PROG):
      $(CC) -o $(PROG) $(LDFLAGS) $(TSFLAGS)
  
  %.o: %.cpp
      $(CC) -c $(CFLAGS) $&lt;
  
  all: $(PROG)
  
  clean:
      rm -f $(PROG)
  </code></pre>
  
  <p>after make I see this error:</p>
  
  <pre><code>g++ -o exp `pkg-config --libs opencv` `/home/username/local/lib/pkgconfig --libs /home/username/local/tesseract`
  /bin/sh: 1: /home/username/local/lib/pkgconfig: Permission denied
  /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
  (.text+0x20): undefined reference to `main'
  collect2: error: ld returned 1 exit status
  Makefile:11: návod pro cíl „exp“ selhal
  make: *** [exp] Chyba 1
  </code></pre>
  
  <p>I even tried to go further and in makefile I changed TSFLAGS ..../lib/pkgconfig/tesseract.pc. After this I saw this problem:</p>
  
  <pre><code>g++ -o exp `pkg-config --libs opencv` `/home/username/local/lib/pkgconfig/tesseract.pc --libs /home/username/local/tesseract`
  /home/username/local/lib/pkgconfig/tesseract.pc: 4: /home/username/local/lib/pkgconfig/tesseract.pc: datarootdir: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 9: /home/username/local/lib/pkgconfig/tesseract.pc: Name:: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 10: /home/username/local/lib/pkgconfig/tesseract.pc: Description:: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 11: /home/username/local/lib/pkgconfig/tesseract.pc: URL:: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 12: /home/username/local/lib/pkgconfig/tesseract.pc: Version:: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 13: /home/username/local/lib/pkgconfig/tesseract.pc: Requires.private:: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 14: /home/username/local/lib/pkgconfig/tesseract.pc: Libs:: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 15: /home/username/local/lib/pkgconfig/tesseract.pc: Libs.private:: not found
  /home/username/local/lib/pkgconfig/tesseract.pc: 16: /home/username/local/lib/pkgconfig/tesseract.pc: Cflags:: not found
  /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
  (.text+0x20): undefined reference to `main'
  collect2: error: ld returned 1 exit status
  Makefile:11: návod pro cíl „exp“ selhal
  make: *** [exp] Chyba 1
  </code></pre>
  
  <p>tesseract.pc looks same on local and with admin rights:</p>
  
  <pre><code>prefix=/home/ondrej_mrhac/local
  exec_prefix=${prefix}
  bindir=${exec_prefix}/bin
  datarootdir = ${prefix}/share
  datadir=${datarootdir}
  libdir=${exec_prefix}/lib
  includedir=${prefix}/include/tesseract
  
  Name: tesseract
  Description: An OCR Engine that was developed at HP Labs between 1985 and 1995... and now at Google.
  URL: https://github.com/tesseract-ocr/tesseract
  Version: 4.00.00dev
  Requires.private: lept
  Libs: -L${libdir} -ltesseract
  Libs.private: -lpthread 
  Cflags: -I${includedir}
  </code></pre>
  
  <p>Any ideas what I am doing wrongly?</p>