【问题标题】:CPPFLAGS set but a header is still not foundCPPFLAGS 已设置,但仍未找到标头
【发布时间】:2016-04-22 12:49:59
【问题描述】:

我用 ./configure 设置了 CPPFLAGS 和 LDFLAGS,但仍然找不到头文件 fst.h。虽然它位于 CPPFLAGS 目录中指定的位置。

./configure CPPFLAGS=-I/Users/username/Downloads/openfst-1.5.1/src/include LDFLAGS=-L/Users/username/Downloads/openfst-1.5.1/src/lib

...

checking for stdint.h... yes
checking for unistd.h... yes
checking fst/fst.h usability... no
checking fst/fst.h presence... no
checking for fst/fst.h... no
configure: error: Required file fst/fst.h not found -- aborting

我错过了什么?

【问题讨论】:

    标签: c++ compilation configure autoconf openfst


    【解决方案1】:

    您实际上并未设置configure 脚本检查的CPPFLAGS 环境变量,而是将CPPFLAGS=-I/Users/username/Downloads/openfst-1.5.1/src/include 作为参数 传递给脚本。与LDFLAGS 相同。

    您应该在脚本之前将它们设置为环境变量,例如

    CPPFLAGS=-I/Users/username/Downloads/openfst-1.5.1/src/include LDFLAGS=-L/Users/username/Downloads/openfst-1.5.1/src/lib ./configure
    

    使用续行更容易一次看到所有内容:

    CPPFLAGS=-I/Users/username/Downloads/openfst-1.5.1/src/include \
    LDFLAGS=-L/Users/username/Downloads/openfst-1.5.1/src/lib \
    ./configure
    

    【讨论】:

    • 感谢您的提示,但我仍然收到完全相同的错误消息
    猜你喜欢
    • 2017-08-04
    • 2019-12-05
    • 2018-05-01
    • 2020-01-28
    • 1970-01-01
    • 1970-01-01
    • 2016-12-25
    • 2019-11-06
    • 2012-06-04
    相关资源
    最近更新 更多