abedra / libvault

A C++ library for Hashicorp Vault
MIT License
34 stars 25 forks source link

fatal error: catch2/catch.hpp: No such file or directory #74

Closed VinayIsHere closed 3 years ago

VinayIsHere commented 3 years ago

When I run make I got the following error

[ 98%] Building CXX object CMakeFiles/libvault_test.dir/test/test.cpp.o
/home/vinay/Documents/VinayPersonal/Contraly/github/libvault/test/test.cpp:2:10: fatal error: catch2/catch.hpp: No such file or directory
    2 | #include <catch2/catch.hpp>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/libvault_test.dir/build.make:63: CMakeFiles/libvault_test.dir/test/test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:484: CMakeFiles/libvault_test.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
abedra commented 3 years ago

Hi @VinayIsHere,

This means you are missing the Catch2 dependency, listed in the README. If you are looking to run the unit or integration test suites, you will need this dependency. If you are simply looking to compile the library without running tests, you can specify -DENABLE_TEST=OFF when running cmake. Details found here

VinayIsHere commented 3 years ago

I have installed the Catch2 from its github but still it is giving this error because the version 3 of Catch2 doesn't include this file catch2/catch.hpp , So I just use the cmake with -DENABLE_TEST=OFF and it works now.

abedra commented 3 years ago

You've likely installed from master. If you take a look at https://github.com/abedra/libvault/blob/master/.github/workflows/cmake.yml#L28-L35 you will see the appropriate version to install. Until the new version of Catch2 is released as stable libvault will use this branch.