1

Hello I'm trying to get a C++ project to run with cmake but when building I always get an error on this line:

find_package(jsoncpp REQUIRED)

the error being:

[cmake] CMake Error at src/scouting/CMakeLists.txt:12 (find_package):
[cmake]   Could not find a configuration file for package "jsoncpp" that is
[cmake]   compatible with requested version "".
[cmake] 
[cmake]   The following configuration files were considered but not accepted:
[cmake] 
[cmake]     /home/moritz/Schreibtisch/DA/airclipObstacleDetection/lib/jsoncpp/build/jsoncppConfig.cmake, version: 1.9.2 (64bit)

I realized it says requested version "" so I changed the line to:

find_package(jsoncpp 1.9.2 REQUIRED)

now the error is:

[cmake] CMake Error at src/scouting/CMakeLists.txt:12 (find_package):
[cmake]   Could not find a configuration file for package "jsoncpp" that is
[cmake]   compatible with requested version "1.9.2".
[cmake] 
[cmake]   The following configuration files were considered but not accepted:
[cmake] 
[cmake]     /home/moritz/Schreibtisch/DA/airclipObstacleDetection/lib/jsoncpp/build/jsoncppConfig.cmake, version: 1.9.2 (64bit)

How is 1.9.2 not compatible with exactly 1.9.2? I guess the "(64bit)" is the key? but I can't add that into find_package, right?

Konny
  • 19
  • 2
  • 3
    "I guess the "(64bit)" is the key?" - Yes, 64bit is a key. It tells that the specific configuration file describes 64bit installation, but your CMake project is 32bit. – Tsyvarev Jun 16 '22 at 21:32

0 Answers0