-2

From a trivial meson.build file, I get the following error:

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

dataStructures.hpp,

The meson.build file is:

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

The file reported as missing is present and it is in the same directory the meson.build file is.

If I remove the 'dataStructures.hpp' string from the list, I get the same error for the second file 'interface.hpp'.

What am I doing wrong?


More details follow.

> 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

In the full log there is no much more than what already reported.

This is the project directory structure:

test/
   meson.build
   src/
       meson.build
       sources
       config/
            meson.build
            sources
       testers/
            meson.build
            sources
       utilities/
            meson.build
            sources
Pietro
  • 12,086
  • 26
  • 100
  • 193

1 Answers1

0

As you don't provide all meson.build file contents, and most importantly the place where it happens - meson.build:27:0: ERROR: File dataStructures.hpp does not exist. - points at line 27 in some meson.build file, I'll try to make a guess that you build executable in root meson.build file, i.e. in test/meson.build however your headers are inside test/src. If that's the case, you don't need to have this array of headers at all, just add

inc = include_directories('./src')

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

include_directories function creates include object with path relative to your source root.

pmod
  • 10,450
  • 1
  • 37
  • 50