【问题标题】:LibHaru QT5 cannot find usr/local/lib, file format not recognizedLibHaru QT5 找不到 usr/local/lib,文件格式无法识别
【发布时间】:2015-05-20 17:08:51
【问题描述】:

我根据页面上的说明从 libharu.org 安装了库(没有任何错误)。然后尝试在qt5中运行一个示例。添加安装目录的路径后

INCLUDEPATH +=/usr/local/include
LIBS +=/usr/local/lib -libhpdf

qt5 似乎找到了它们(标题下划线消失了)。 但是在调试过程中会显示错误

cannot find /usr/local/lib: File format not recognized
cannot find -libhpdf

LIBS += -L/usr/... 

相反,每个 libharu 标头 undefined reference to HPDF_xxx 都会出错

【问题讨论】:

  • 我不确定;但是INCLUDEPATH +=/usr/local/includeLIBS +=-L/usr/local/lib -lhpdf 呢?注意我使用-lhpdf 而不是-libhpdf 并确保文件hpdf.a 存在于上述路径中。
  • 成功了。谢谢! :)
  • 不客气。。希望采纳下面的答案。

标签: qt qt5 ubuntu-14.04 libharu


【解决方案1】:
INCLUDEPATH +=/usr/local/include 
LIBS +=-L/usr/local/lib -lhpdf 

请注意,我使用了-lhpdf 而不是-libhpdf,并确保文件libhpdf.a 存在于上述路径中。 看到这个答案:How to include needed C library using gcc?

【讨论】:

    猜你喜欢
    • 2015-07-05
    • 2020-04-12
    • 1970-01-01
    • 1970-01-01
    • 2015-08-25
    • 2013-04-25
    • 1970-01-01
    • 1970-01-01
    • 2013-07-27
    相关资源
    最近更新 更多