Package 'apr-1', required by 'virtual:world', not found - c++

I just installed vcpkg and installed spdlog through it, and encountered this error:
-- Checking for module 'apr-1'
-- Package 'apr-1', required by 'virtual:world', not found
CMake Error at /usr/local/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
APR_INCLUDE_DIR (missing: APR_LIBRARIES)
Call Stack (most recent call first):
/usr/local/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
thirdpart/logging-log4cxx/src/cmake/FindAPR.cmake:83 (find_package_handle_standard_args)
thirdpart/logging-log4cxx/CMakeLists.txt:50 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/dbn/work/seal/CMakeFiles/CmakeOutput.log".
I thought the problem was that I missed the APR lib, but when I installed APR, it still produced the same error.
Then i try to delete a log4cxx lib , i get this error
CMake Error at CMakeLists.txt:24 (find_package): Could not find a
package configuration file provided by "spdlog" with any of the
following names: spdlogConfig.cmake spdlog-config.cmake Add the
installation prefix of "spdlog" to CMAKE_PREFIX_PATH or set "spdlog_DIR"
to a directory containing one of the above files. If "spdlog" provides a
separate development package or SDK, be sure it has been installed.
But I actually install spdlog ,and I check the dir found the spdlog lib exactly in it .
How can I resolve this error?

I fix it by sudo yum install spdlog-devel
The proble is that vcpkg install lib but miss some dependency?
here is the reference https://github.com/gabime/spdlog/issues/1167

Related

CMake cannot find OpenSSL libraries in windows

This is my cmake file:
cmake_minimum_required(VERSION 3.5.1)
set(PACKAGE_NAME "atest")
find_package(OpenSSL REQUIRED)
project(${PACKAGE_NAME} LANGUAGES C CXX)
I have a custom openssl binary that I wanna use in a folder
C:\MyOpenSSL\
C:\MyOpenSSL\include\ ... all the include files here
C:\MyOpenSSL\lib\ ... libssl.lib, libcrypto.lib and ossl_static.pdb
So when I run, CMake . -DOPENSSL_ROOT_DIR=C:\MyOpenSSL\
I get the following errors:
C:/cmake/cmake-3.22.2-win/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY) (found
version "1.1.1c")
Call Stack (most recent call first):
C:/cmake/cmake-3.22.2-win/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/cmake/cmake-3.22.2-win/share/cmake-3.22/Modules/FindOpenSSL.cmake:574 (find_package_handle_standard_args)
CMakeLists.txt:5 (find_package)
What am I missing here? Is somehow find_package found out the version v1.1.1c, but still saying it couldn't find it?
It turns out if I build and install openssl manually it works.
For whatever reason the raw lib i provided was not good enough for cmake to find it. I am still not sure why.

Cmake not able to find CGAL library(installed using vcpkg)

This is the error message:
CMake Error at D:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake:788 (_find_package):
By not providing "FindCGAL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CGAL", but
CMake did not find one.
Could not find a package configuration file provided by "CGAL" with any of
the following names:
CGALConfig.cmake
cgal-config.cmake
Add the installation prefix of "CGAL" to CMAKE_PREFIX_PATH or set
"CGAL_DIR" to a directory containing one of the above files. If "CGAL"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:16 (find_package)
I am trying to use the vcpkg toolchain file when building the project in Cmake; so all my installed libraries are available for Cmake but it is not working.

catkin can't find qt_build after sudo upgrade

I was working on my project and I accidentally did sudo apt-get upgrade.
Now I have some issues that I don't understand.
When I do catkin_make in my workspace, it says that cannot find the qt_build package and that I need to install it in CMAKE_PREFIX_PATH.
CMake Warning at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "qt_build" with any
of the following names:
qt_buildConfig.cmake
qt_build-config.cmake
Add the installation prefix of "qt_build" to CMAKE_PREFIX_PATH or set
"qt_build_DIR" to a directory containing one of the above files. If
"qt_build" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
motion_manager/CMakeLists.txt:31 (find_package)
---Could not find the required component 'qt_build'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "qt_build" with any
of the following names:
qt_buildConfig.cmake
qt_build-config.cmake
Add the installation prefix of "qt_build" to CMAKE_PREFIX_PATH or set
"qt_build_DIR" to a directory containing one of the above files. If
"qt_build" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
motion_manager/CMakeLists.txt:31 (find_package)
However, the package qt_build is already in that directory.
joao#joao-X580VD:~/ros_ws$ echo $CMAKE_PREFIX_PATH
/opt/ros/kinetic
joao#joao-X580VD:~/ros_ws$ cd /opt/ros/kinetic
joao#joao-X580VD:/opt/ros/kinetic$ locate qt_build
/opt/ros/kinetic/lib/pkgconfig/qt_build.pc
/opt/ros/kinetic/share/qt_build
/opt/ros/kinetic/share/qt_build/cmake
/opt/ros/kinetic/share/qt_build/package.xml
/opt/ros/kinetic/share/qt_build/cmake/qt-ros.cmake
/opt/ros/kinetic/share/qt_build/cmake/qt_buildConfig-version.cmake
/opt/ros/kinetic/share/qt_build/cmake/qt_buildConfig.cmake
/snap/kde-frameworks-5-core18/32/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_build_config.prf
/snap/kde-frameworks-5-core18/32/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_build_extra.prf
/snap/kde-frameworks-5-core18/32/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_build_paths.prf
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_build_config.prf
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/features/qt_build_paths.prf
Before the upgrade everything was working fine, but now I get this error.
Does anyone know how to solve such problem? Thank you

cmake can not find openssl on windows

I already read this post and it did not answer my questions: (cmake not able to find openssl)
I am working in windows 10 64 bit and I want to use boost asio with ssl support, so I installed openssl in C:\Local\OpenSSL-Win64 and I have a environment variable pointing to this.
I have this code in cmake:
file(TO_CMAKE_PATH $ENV{OPENSSL_ROOT} OPENSSL_ROOT_DIR)
message(WARNING "root: ${OPENSSL_ROOT_DIR}")
find_package(OpenSSL )
message(WARNING "OpenSSL_VERSION: ${OPENSSL_VERSION}")
message(WARNING "OpenSSL_INCLUDE_DIR: ${OPENSSL_INCLUDE_DIR}")
message(WARNING "OpenSSL_LIBRARIES: ${OPENSSL_LIBRARIES}")
and when I run the cmake, I am getting this message:
CMake Warning at CMakeLists.txt:44 (message):
root: C:/Local/OpenSSL-Win64
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindOpenSSL.cmake:293 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:45 (find_package)
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindOpenSSL.cmake:294 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:45 (find_package)
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindOpenSSL.cmake:296 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:45 (find_package)
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindOpenSSL.cmake:298 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:45 (find_package)
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES) (found version ".0.0`")
CMake Warning at CMakeLists.txt:47 (message):
OpenSSL_VERSION: .0.0`
CMake Warning at CMakeLists.txt:48 (message):
OpenSSL_INCLUDE_DIR: C:/Local/OpenSSL-Win64/include
CMake Warning at CMakeLists.txt:49 (message):
OpenSSL_LIBRARIES: SSL_EAY_LIBRARY-NOTFOUND;LIB_EAY_LIBRARY-NOTFOUND
as it can be seen the cmake could find the environment variable which is correctly pointed to C:/Local/OpenSSL-Win64
also interestingly, it can find the include path:
CMake Warning at CMakeLists.txt:48 (message):
OpenSSL_INCLUDE_DIR: C:/Local/OpenSSL-Win64/include
but the version, and include library is not right.
is there any specific ways that I can force cmake to find the openssl?
How can I make sure that it finds the suitable static library?
Edit 1
Aftre upgrading to cmake 3.8, now, cmake can find openssl, but not its libraries. The output is as follow:
Found OpenSSL: C:/Local/OpenSSL-Win64/lib/libssl.lib (found version "1.1.0e")
CMake Warning at CMakeLists.txt:52 (message):
OpenSSL_VERSION: 1.1.0e
CMake Warning at CMakeLists.txt:53 (message):
OpenSSL_INCLUDE_DIR: C:/Local/OpenSSL-Win64/include
CMake Warning at CMakeLists.txt:54 (message):
OpenSSL_LIBRARIES:
Why libraries are not found?
Edit 2
The reason that it could not find library was that I used the variable name with a different case. The correct name is OPENSSL_LIBRARIES.
For more information read the findopenssl.cmake file as part of the cmake distribution.
More recent OpenSSL versions (the 1.1.x series I think) slightly changed the formatting of how the version number was specified in the opensslv.h header. This caused CMake's version parsing code in its FindOpenSSL.cmake module to fail, which was then fixed around CMake 3.5.0. Furthermore, from OpenSSL 1.1.0, the library names on Windows are closer to their Unix counterparts and are named libcrypto and libssl (possibly with further suffixes) instead of the old names libeay32 and ssleay32. CMake 3.7.0 contained the update to account for this library name change. As a result of these two changes and fixes, if you want to use OpenSSL 1.1.0 or later with a CMake project, you should probably be using CMake 3.7.0 or later.
We had a similar problem with cmake 2.8.12.2 and OpenSSL 1.0.2u
CMake Error at /usr/share/cmake/Modules/FindOpenSSL.cmake:278 (list):
list GET given empty list
Call Stack (most recent call first):
CMakeLists.txt:169 (FIND_PACKAGE)
To find out more details, you can add "--debug-output" option to cmake command.
In our case, it helped to specify the -D_OPENSSL_VERSION on cmake command line:
OPENSSL_VER=1.0.2u
cmake ...
-DOPENSSL_ROOT_DIR=$IDIR_BASE \
-DOPENSSL_INCLUDE_DIR=$IDIR_BASE/include \
-D_OPENSSL_VERSION="$OPENSSL_VER" \

qt creator opencv windows cmake error

I want to configure and then generate opencv library for qt creator to link them.
I opened cmake 3.1.0 and typed in the source and build path.
source:
C:/Users/Philipp_Laptop/Downloads/opencv/sources
build: C:/opencv-mingw
Then I configured the mingw-compiler with the path:
C:/Qt/Tools/mingw482_32/bin/gcc.exe
C:/Qt/Tools/mingw482_32/bin/g++.exe
After successful configure i set the with_Qt option.
I configured it twice and it shows me the following error:
Detected version of GNU GCC: 48 (408)
CMake Warning (dev) at cmake/OpenCVUtils.cmake:261 (if):
Policy CMP0054 is not set: Only interpret if() arguments as variables or
keywords when unquoted. Run "cmake --help-policy CMP0054" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
Quoted variables like "WIN32" will no longer be dereferenced when the
policy is set to NEW. Since the policy is not set the OLD behavior will be
used.
Call Stack (most recent call first):
CMakeLists.txt:127 (OCV_OPTION)
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:18 (find_package):
By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Core", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5Core" with any
of the following names:
Qt5CoreConfig.cmake
qt5core-config.cmake
Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
"Qt5Core_DIR" to a directory containing one of the above files. If
"Qt5Core" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:19 (find_package):
By not providing "FindQt5Gui.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Gui", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5Gui" with any
of the following names:
Qt5GuiConfig.cmake
qt5gui-config.cmake
Add the installation prefix of "Qt5Gui" to CMAKE_PREFIX_PATH or set
"Qt5Gui_DIR" to a directory containing one of the above files. If "Qt5Gui"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:20 (find_package):
By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"Qt5Widgets", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Widgets" with
any of the following names:
Qt5WidgetsConfig.cmake
qt5widgets-config.cmake
Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
"Qt5Widgets_DIR" to a directory containing one of the above files. If
"Qt5Widgets" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:21 (find_package):
By not providing "FindQt5Test.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Qt5Test", but
CMake did not find one.
Could not find a package configuration file provided by "Qt5Test" with any
of the following names:
Qt5TestConfig.cmake
qt5test-config.cmake
Add the installation prefix of "Qt5Test" to CMAKE_PREFIX_PATH or set
"Qt5Test_DIR" to a directory containing one of the above files. If
"Qt5Test" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
CMake Warning at cmake/OpenCVFindLibsGUI.cmake:22 (find_package):
By not providing "FindQt5Concurrent.cmake" in CMAKE_MODULE_PATH this
project has asked CMake to find a package configuration file provided by
"Qt5Concurrent", but CMake did not find one.
Could not find a package configuration file provided by "Qt5Concurrent"
with any of the following names:
Qt5ConcurrentConfig.cmake
qt5concurrent-config.cmake
Add the installation prefix of "Qt5Concurrent" to CMAKE_PREFIX_PATH or set
"Qt5Concurrent_DIR" to a directory containing one of the above files. If
"Qt5Concurrent" provides a separate development package or SDK, be sure it
has been installed.
Call Stack (most recent call first):
CMakeLists.txt:447 (include)
Looking for Q_WS_X11
Looking for Q_WS_X11 - not found
Looking for Q_WS_WIN
Looking for Q_WS_WIN - found
Looking for Q_WS_QWS
Looking for Q_WS_QWS - not found
Looking for Q_WS_MAC
Looking for Q_WS_MAC - not found
Found OpenGL: opengl32
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
Could NOT find Qt4 (missing: QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE
QT_QTTEST_LIBRARY QT_UIC_EXECUTABLE) (found version "4.8.6")
Call Stack (most recent call first):
C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files (x86)/CMake/share/cmake-3.1/Modules/FindQt4.cmake:1331 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
cmake/OpenCVFindLibsGUI.cmake:34 (find_package)
CMakeLists.txt:447 (include)
Configuring incomplete, errors occurred!
See also "C:/opencv-mingw/CMakeFiles/CMakeOutput.log".
See also "C:/opencv-mingw/CMakeFiles/CMakeError.log".
I used CMake GUI under Windows for this so I'll refer to this approach.
Let's start from problems related to CMAKE_PREFIX_PATH not defined.
To solve this you simply have to press ADD on the CMAKE GUI and add the variable of type PATH named CMAKE_PREFIX_PATH with value C:/Bin/Qt/5.3/mingw482_32/lib/cmake/ but using your own installation of Qt5. The directory you point now contains all modules you need: Qt5 directory, Qt5AxBase...
At this point you press configure and you should have QT_QMAKE_EXECUTABLE not valid. You need to set it properly, in my case: C:/Bin/Qt/5.3/mingw482_32/bin/qmake.exe.
Then press configuration again and see if some error is still present (you have others error I never saw but maybe they are consequence of the previous ones), in my case this solved all issues and the build proceeded.
The MINGW configuration seems to be fine: I did slightly different just putting the bin MINGW path in PAT variable as first entry and using the default compiler from CMAKE (but your solution is as valid as my one).