IT Log

Record various IT issues and difficulties.

Regarding the Issue of Find_Package Not Finding After Installing Log4cplus via Vcpkg in a Qt Project in CLion


To resolve the issue where find_package cannot locate log4cplus after installing it with vcpkg in a Qt project within CLion, follow these steps:

  1. Verify Installation Location:
  2. Check the directory structure under your vcpkg installation to confirm that log4cplus was successfully installed.

  3. Set Environment Variables:

  4. Add the paths to vcpkg\installed\x64windows\include and vcpkg\installed\x64windows\lib (adjust for your system) to your environment’s INCLUDE and LIB variables, respectively.

  5. Review CMake Configuration:

  6. In your project’s CMakeLists.txt, ensure that find_package(log4cplus REQUIRED) is correctly used. You might need to specify the exact version or set VCPKG_ROOT if necessary.

  7. Adjust CLion Settings:

  8. Navigate to File > Settings (or Preferences) and add the include and library paths from your vcpkg installation to the project’s configurations.

By following these steps, you should be able to resolve the issue where find_package fails to locate log4cplus, allowing your Qt project to compile successfully with CLion.


, , , ,