C++ Catch: Can't find header files for catch

I am trying to build with C++ using catch tests.

However, it can’t find the headers after installing catch.

https://travis-ci.com/TheShed412/file-sorter/jobs/238848466

In that build I install catch explicitly in the before_install, but I have other tests that I install it in the apt packages section of the yml. Neither seem to be working.

I am running Ubuntu 18 on my local machine and was able to install catch with the command in the before_install and have it working.

Where is catch/catch.hpp and is it in the search path?

I’m not sure. I didn’t have to add it to build locally. So I believe it is, but I’m not certain.

Is there a way I can check?

The package catch puts that file in /usr/include/catch.hpp. I don’t know how your local machine is finding it as catch/catch.hpp, but something seems amiss.

Ah, I see. In bionic, there is also catch/catch.hpp.

Ahhh ok, does xenial not add it?

If the package’s file list is to be believed, then, no, it does not. You’ll have to either:

  1. Refer to this header file as <catch.cpp>
  2. Create the symlink /usr/include/catch/catch.hpp to /usr/include/catch.hpp (assuming that they should be the same)

We have an experimental bionic image, but this may or may not work with C++ builds.

1 Like

That did it! I wasn’t sure if that would also work on my local but it seems to.

Thanks!