我从here下载了柯南的最新版本,然后我完成了以下操作。
main.cpp
#include "Poco/MD5Engine.h"
#include "Poco/DigestStream.h"
#include <iostream>
int main(int argc, char** argv)
{
Poco::MD5Engine md5;
Poco::DigestOutputStream ds(md5);
ds << "abcdefghijklmnopqrstuvwxyz";
ds.close();
std::cout << Poco::DigestEngine::digestToHex(md5.digest()) << std::endl;
return 0;
}
CMakeList.txt
cmake_minimum_required(VERSION 3.25)
project(TestMailPrj)
set(CMAKE_CXX_STANDARD 20)
find_package(poco REQUIRED)
add_executable(TestMailPrj main.cpp)
target_link_libraries(${PROJECT_NAME} POCO)
conanfile.txt
[requires]
cmake/3.25.3
poco/1.12.4
[generators]
CMakeDeps
CMakeToolchain
conan install . --output-folder=build --build=missing
现在,即使我的所有依赖项都已正确安装,在 CMakeFile 中它也找不到我的 poco 库。
By not providing "Findpoco.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "poco", but CMake did not find one.
Could not find a package configuration file provided by "poco" with any of the following names:
pocoConfig.cmake
poco-config.cmake
Add the installation prefix of "poco" to CMAKE_PREFIX_PATH or set "poco_DIR" to a directory containing one of the above files. If "poco" provides a separate development package or SDK, be sure it has been installed.
有人知道我到底做错了什么还是这是一个错误?