Linux 如何使用libharu在centos中创建pdf文件

Linux 如何使用libharu在centos中创建pdf文件,linux,gcc,Linux,Gcc,我试图使用libharu库生成pdf文件,但我已经编译了代码,它创建目标文件,同时运行可执行文件 错误如下:未定义的引用“打印网格” 首先,我导出路径: export PATH="$PATH:/usr/local/lib/libhpdf.so" 编撰 gcc -c text_demo.c -o text_demo.o gcc text_demo.o -L"/usr/loca/lib" -lhpdf -o "text_demo.exe" 试试这个: 1确保已将libhpdf.so实际安装到/

我试图使用libharu库生成pdf文件,但我已经编译了代码,它创建目标文件,同时运行可执行文件

错误如下:未定义的引用“打印网格”

首先,我导出路径:

export PATH="$PATH:/usr/local/lib/libhpdf.so"
编撰

gcc -c text_demo.c -o text_demo.o

gcc text_demo.o -L"/usr/loca/lib" -lhpdf -o "text_demo.exe"
试试这个:

1确保已将libhpdf.so实际安装到/usr/local/lib中

2编译并链接:gcc-Wall-g text_demo.c-L/usr/local/lib-lhpdf-o text_demo

请注意,您不需要exe,也不需要额外的引号

还要注意,$PATH与共享库路径无关。那是窗户;Linux使用$LD_LIBRARY_路径

3型ldd文本演示

这将检查任何运行时依赖项

4最后,试着运行你的程序:./text\u demo


5请在构建、ldd或执行过程中复制/粘贴任何准确的错误消息。

您需要安装libharu和libharu-devel软件包

请在此找到centos 5或centos 6的合适包装


然后编译您的源代码

它的gving仍然是相同的错误[root@hemanthdemo]LD_LIBRARY_PATH=/usr/local/lib[root@hemanth演示]导出LD_库_路径[root@hemanth演示]gcc-Wall-g text_demo.c-L/usr/local/lib-lhfd-o text_demo/tmp/ccjsFLyt.o:In function main':/home/hemanth/libharu-libharu-ec89be4/demo/text_demo.c:129:打印网格的未定义引用“collect2:ld返回1退出状态[root@hemanth演示]ldd text_demo ldd:./text_demo:没有这样的文件或目录您安装过libharu和libharu-devel包吗?用这个命令gcc-Wall-g-I/usr/include/text_demo.c-L/usr/lib/-o text_demo-lhpdfw编译text_demo.c的内容是什么?