-1

从一个简单的meson.build文件中,我收到以下错误:

meson.build:27:0:错误:文件 dataStructures.hpp 不存在。

dataStructures.hpp,

meson.build文件是:

headers += [
    'dataStructures.hpp',
    'interface.hpp',
    'platform.hpp',
    'progArgs.hpp',
]

报告为丢失的文件存在,它与 meson.build 文件位于同一目录中。

如果我从列表中删除“dataStructures.hpp”字符串,第二个文件“interface.hpp”也会出现同样的错误。

我究竟做错了什么?


更多细节如下。

> CC=clang CXX=clang++ meson /dev/shm/test-build
The Meson build system
Version: 0.52.0
Source dir: /home/pietrom/myProgs/test
Build dir: /dev/shm/test-build
Build type: native build
Project name: test
Project version: 0.0.1
C++ compiler for the host machine: clang++ (clang 8.0.1 "clang version 8.0.1 (tags/RELEASE_801/final)")
C++ linker for the host machine: GNU ld.bfd 2.32
Host machine cpu family: x86_64
Host machine cpu: x86_64

src/meson.build:27:0: ERROR: File dataStructures.hpp does not exist.

A full log can be found at /dev/shm/test-build/meson-logs/meson-log.txt

在完整的日志中没有比已经报告的更多。

这是项目目录结构:

test/
   meson.build
   src/
       meson.build
       sources
       config/
            meson.build
            sources
       testers/
            meson.build
            sources
       utilities/
            meson.build
            sources
4

1 回答 1

0

由于您没有提供所有 meson.build 文件内容,最重要的是它发生的地方 - meson.build:27:0: ERROR: File dataStructures.hpp 不存在。- 在某些 meson.build 文件中的第 27 行,我将尝试猜测您在根meson.build文件中构建可执行文件,即在test/meson.build中,但是您的标头在test/src中。如果是这种情况,您根本不需要这个标题数组,只需添加

inc = include_directories('./src')

some_test_exe = executable('mytest',
  test_sources,
  ...
  include_directories : inc
)

include_directories函数创建包含路径相对于源根目录的包含对象。

于 2019-11-18T08:17:35.920 回答