2
回答
Error: cannot locate fontforge.h
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

@王璐 你好,想跟你请教个问题:

报错如下:

[root@localhost coolwanglu-pdf2htmlEX-a124926]# cmake .
-- checking for module 'libfontforge>=2.0.0'
--   package 'libfontforge>=2.0.0' not found
Trying to locate old versions of fontforge...
CMake Error at CMakeLists.txt:62 (message):
  Error: cannot locate fontforge.h

-- Configuring incomplete, errors occurred!

centos 6.4    64位系统安装的包如下:

[root@localhost pdf2html]# ls
coolwanglu-pdf2htmlEX-a124926                    poppler-0.20.3.tar.gz
coolwanglu-pdf2htmlEX-v0.8.1-72-ga124926.tar.gz  
fontforge-20120731-b                            
fontforge_full-20120731-b.tar.bz2                xpdfbin-linux-3.03
poppler-0.20.3                                   xpdfbin-linux-3.03.tar.gz

fontforge-20120731-b  我用源码安装到了/usr/local/fontforge下

谢谢

举报
thrillerzw
发帖于4年前 2回/406阅
共有2个答案 最后回答: 4年前
由于你安装的路径不是标准路径,需要把头文件和库文件的位置分别放到include path和library path里,让cmake能找到,可能还需要设置ld library path

引用来自“王璐”的答案

由于你安装的路径不是标准路径,需要把头文件和库文件的位置分别放到include path和library path里,让cmake能找到,可能还需要设置ld library path

还是不行,帮我看下我的配置

/etc/profile:

#gcc找到头文件的路径
C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/fontforge/include/fontforge
export C_INCLUDE_PATH


#g++找到头文件的路径
CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/local/fontforge/include/fontforge
export CPLUS_INCLUDE_PATH


#找到动态链接库的路径
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/fontforge/lib 
export LD_LIBRARY_PATH


#找到静态库的路径
LIBRARY_PATH=$LIBRARY_PATH:/usr/local/fontforge/lib
export LIBRARY_PATH


/etc/bashrc:
export LD_LIBRARY_PATH=/usr/local/fontforge/lib:$LD_LIBRARY_PATH


之后都source 使之生效了
顶部