首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何从控制台安装LEPTONICA版本?

如何从控制台安装LEPTONICA版本?
EN

Stack Overflow用户
提问于 2020-12-11 23:22:09
回答 1查看 352关注 0票数 0

我在CentOs 8上以这种形式安装了http://www.leptonica.org/source/leptonica-1.80.0.tar.gz

代码语言:javascript
复制
wget http://www.leptonica.org/source/leptonica-1.80.0.tar.gz
tar xzvf leptonica-1.80.0.tar.gz
cd leptonica-1.80.0
./configure
make && make install

最后,我得到以下输出:

代码语言:javascript
复制
  ...
  ...
  ...
    CC       wordsinorder.o
    CCLD     wordsinorder
    CC       writemtiff.o
    CCLD     writemtiff
    CC       yuvtest.o
    CCLD     yuvtest
  make[2]: Leaving directory `/leptonica-1.80.0/prog'
  make[2]: Entering directory `/leptonica-1.80.0'
  make[2]: Leaving directory `/leptonica-1.80.0'
  make[1]: Leaving directory `/leptonica-1.80.0'
  Making install in src
  make[1]: Entering directory `/leptonica-1.80.0/src'
  make[2]: Entering directory `/leptonica-1.80.0/src'
   /usr/bin/mkdir -p '/usr/local/lib'
   /bin/sh ../libtool   --mode=install /usr/bin/install -c   liblept.la '/usr/local/lib'
  libtool: install: /usr/bin/install -c .libs/liblept.so.5.0.4 /usr/local/lib/liblept.so.5.0.4
  libtool: install: (cd /usr/local/lib && { ln -s -f liblept.so.5.0.4 liblept.so.5 || { rm -f liblept.so.5 && ln -s liblept.so.5.0.4 liblept.so.5; }; })
  libtool: install: (cd /usr/local/lib && { ln -s -f liblept.so.5.0.4 liblept.so || { rm -f liblept.so && ln -s liblept.so.5.0.4 liblept.so; }; })
  libtool: install: /usr/bin/install -c .libs/liblept.lai /usr/local/lib/liblept.la
  libtool: install: /usr/bin/install -c .libs/liblept.a /usr/local/lib/liblept.a
  libtool: install: chmod 644 /usr/local/lib/liblept.a
  libtool: install: ranlib /usr/local/lib/liblept.a
  libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/lib
  ----------------------------------------------------------------------
  Libraries have been installed in:
     /usr/local/lib

  If you ever happen to want to link against installed libraries
  in a given directory, LIBDIR, you must either use libtool, and
  specify the full pathname of the library, or use the '-LLIBDIR'
  flag during linking and do at least one of the following:
     - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
       during execution
     - add LIBDIR to the 'LD_RUN_PATH' environment variable
       during linking
     - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
     - have your system administrator add LIBDIR to '/etc/ld.so.conf'

  See any operating system documentation about shared libraries for
  more information, such as the ld(1) and ld.so(8) manual pages.
  ----------------------------------------------------------------------
   /usr/bin/mkdir -p '/usr/local/include/leptonica'
   /usr/bin/install -c -m 644 allheaders.h alltypes.h array.h arrayaccess.h bbuffer.h bilateral.h bmf.h bmfdata.h bmp.h ccbord.h colorfill.h dewarp.h endianness.h environ.h gplot.h heap.h imageio.h jbclass.h leptwin.h list.h morph.h pix.h ptra.h queue.h rbtree.h readbarcode.h recog.h regutils.h stack.h stringcode.h sudoku.h watershed.h '/usr/local/include/leptonica'
  make  install-data-hook
  make[3]: Entering directory `/leptonica-1.80.0/src'
  cd /usr/local/lib;\
  for ext in a la so sl dylib; do\
          if test -f liblept.$ext; then\
                  ln -s liblept.$ext libleptonica.$ext;\
          fi;\
  done
  make[3]: Leaving directory `/leptonica-1.80.0/src'
  make[2]: Leaving directory `/leptonica-1.80.0/src'
  make[1]: Leaving directory `/leptonica-1.80.0/src'
  Making install in prog
  make[1]: Entering directory `/leptonica-1.80.0/prog'
  make[2]: Entering directory `/leptonica-1.80.0/prog'
   /usr/bin/mkdir -p '/usr/local/bin'
    /bin/sh ../libtool   --mode=install /usr/bin/install -c convertfilestopdf convertfilestops convertformat convertsegfilestopdf convertsegfilestops converttopdf converttops fileinfo imagetops xtractprotos '/usr/local/bin'
  libtool: install: /usr/bin/install -c .libs/convertfilestopdf /usr/local/bin/convertfilestopdf
  libtool: install: /usr/bin/install -c .libs/convertfilestops /usr/local/bin/convertfilestops
  libtool: install: /usr/bin/install -c .libs/convertformat /usr/local/bin/convertformat
  libtool: install: /usr/bin/install -c .libs/convertsegfilestopdf /usr/local/bin/convertsegfilestopdf
  libtool: install: /usr/bin/install -c .libs/convertsegfilestops /usr/local/bin/convertsegfilestops
  libtool: install: /usr/bin/install -c .libs/converttopdf /usr/local/bin/converttopdf
  libtool: install: /usr/bin/install -c .libs/converttops /usr/local/bin/converttops
  libtool: install: /usr/bin/install -c .libs/fileinfo /usr/local/bin/fileinfo
  libtool: install: /usr/bin/install -c .libs/imagetops /usr/local/bin/imagetops
  libtool: install: /usr/bin/install -c .libs/xtractprotos /usr/local/bin/xtractprotos
  make[2]: Nothing to be done for `install-data-am'.
  make[2]: Leaving directory `/leptonica-1.80.0/prog'
  make[1]: Leaving directory `/leptonica-1.80.0/prog'
  make[1]: Entering directory `/leptonica-1.80.0'
  make[2]: Entering directory `/leptonica-1.80.0'
  make[2]: Nothing to be done for `install-exec-am'.
   /usr/bin/mkdir -p '/usr/local/lib/cmake/'
   /usr/bin/install -c -m 644 cmake/templates/LeptonicaConfig.cmake cmake/templates/LeptonicaConfig-version.cmake '/usr/local/lib/cmake/'
   /usr/bin/mkdir -p '/usr/local/lib/pkgconfig'
   /usr/bin/install -c -m 644 lept.pc '/usr/local/lib/pkgconfig'
  make[2]: Leaving directory `/leptonica-1.80.0'
  make[1]: Leaving directory `/leptonica-1.80.0'
  [root@guest ~]#

然而,我希望检查/确认版本LEPTONICA安装在此服务器和其他服务器,许多搜索在谷歌,但我只找到这个命令:

代码语言:javascript
复制
[root@guest /]# ldconfig -p | grep -i lept
        liblept.so.5 (libc6,x86-64) => /lib64/liblept.so.5
[root@guest /]#

但这只显示“是,LEPTONICA已安装!”

请告诉我如何从控制台获取LEPTONICA版本?

如何全局添加/put路径到leptopnica以安装任何其他需要LEPTONICA的软件?

谢谢

EN

回答 1

Stack Overflow用户

发布于 2021-08-31 12:00:36

使用pkg-config工具: pkg-config --modversion lept

或者创建这个简单的程序(leptonica_version.c):

代码语言:javascript
复制
#include <leptonica/allheaders.h>

int main() {
  char *versionStrP;
  versionStrP = getLeptonicaVersion();
  printf("%s\n", versionStrP);
  lept_free(versionStrP);
  
  versionStrP = getImagelibVersions();
  printf("  %s\n", versionStrP);
  lept_free(versionStrP);
  return 0;
}

可以很容易地使用以下命令进行编译:

代码语言:javascript
复制
gcc leptonica_version.c -o leptonica_version -I/usr/local/include -L/usr/local/lib -llept
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65254034

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档