Tesseract运行本地Makefile - pkgconfig:权限被拒绝

时间:2017-04-04 18:00:25

标签: c++ makefile permissions tesseract pkg-config

使用Leptonica作为管理员运行Tesseract没有问题。但是在管理员权限 - 本地运行Tesseract时遇到小问题。

Makefile看起来像:

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) $<

all: $(PROG)

clean:
    rm -f $(PROG)

make后我看到了这个错误:

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

我甚至试图更进一步,在makefile中我更改了TSFLAGS .... / lib / pkgconfig / tesseract.pc。在此之后,我看到了这个问题:

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

tesseract.pc在本地和管理员权限上看起来相同:

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}

任何想法我做错了什么?

0 个答案:

没有答案