0

For the very first time I'm using Hunter.

(base) raphy@raohy:~/MyPrj$ mkdir cmake
(base) raphy@raohy:~/MyPrj$ wget https://
raw.githubusercontent.com/cpp-pm/gate/master/cmake/HunterGate.cmake -O cmake/HunterGate.cmake

I included hunter in my project CMakeLists.txt :

cmake_minimum_required(VERSION 3.15...3.31)

include("cmake/HunterGate.cmake")
HunterGate(
    URL "https://github.com/cpp-pm/hunter/archive/v0.23.216.tar.gz"
    SHA1 "a492a1879bee60c29f7af17ef56b45f0d7766241"
)

project(MyPrj)

set(ENV{GITHUB_HUNTER_USERNAME} "MyGitHubRepo")
set(ENV{GITHUB_HUNTER_TOKEN=} "MyGitHubToken")


hunter_add_package(ibp2p)
find_package(libp2p REQUIRED)

Executing the compiling phase I get this error message:

(base) raphy@raohy:~/MyPrj$ cmake -B builddir -Wno-dev

-- [hunter] Calculating Toolchain-SHA1
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


-- [hunter] Calculating Config-SHA1
-- [hunter] HUNTER_ROOT: /home/raphy/.hunter
-- [hunter] [ Hunter-ID: a492a18 | Toolchain-ID: fb15dbb | Config-ID: a3b78aa ]

[hunter ** INTERNAL **] Unexpected empty string
[hunter ** INTERNAL **] [Directory:/home/raphy/MyPrj]

------------------------------ ERROR -----------------------------
    https://docs.hunter.sh/en/latest/reference/errors/error.internal.html
------------------------------------------------------------------
    
    CMake Error at /home/raphy/.hunter/_Base/Download/Hunter/0.23.216/a492a18/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
    Call Stack (most recent call first):
      /home/raphy/.hunter/_Base/Download/Hunter/0.23.216/a492a18/Unpacked/cmake/modules/hunter_internal_error.cmake:13 (hunter_error_page)
      /home/raphy/.hunter/_Base/Download/Hunter/0.23.216/a492a18/Unpacked/cmake/modules/hunter_assert_not_empty_string.cmake:9 (hunter_internal_error)
      /home/raphy/.hunter/_Base/Download/Hunter/0.23.216/a492a18/Unpacked/cmake/modules/hunter_get_package_sha1.cmake:26 (hunter_assert_not_empty_string)
      /home/raphy/.hunter/_Base/Download/Hunter/0.23.216/a492a18/Unpacked/cmake/modules/hunter_download.cmake:82 (hunter_get_package_sha1)
      /home/raphy/.hunter/_Base/Download/Hunter/0.23.216/a492a18/Unpacked/cmake/modules/hunter_add_package.cmake:53 (hunter_download)
      CMakeLists.txt:197 (hunter_add_package)

In /home/raphy/.hunter/_Base/Download/Hunter/0.23.216/a492a18/Unpacked/cmake/modules/hunter_get_package_sha1.cmake : the indicated line is the following:

hunter_assert_not_empty_string("${x_VERSION}")

Other info:

cmake version 3.31.20241217-gabb3d39
OS: Ubuntu 24.04

What am I doing wrong and/or missing? How to make it work?

3
  • Why do you use such antique Hunter of the Sep 18, 2019? Commented Oct 10 at 12:24
  • @3CEZVQ Unfortunately to use libp2p I have to use Hunter: github.com/libp2p/… Commented Oct 10 at 12:33
  • Ok, use it. But why do you use such antique Hunter of the Sep 18, 2019? You seem to blindly copy some old tutorial example and not follow the actual libp2p manual. Commented Oct 10 at 23:58

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.