我正在尝试使用 dart:ffi 将 OpenSSL 与 Flutter 一起使用,但是当我在 Ubuntu 20.04 上运行该项目时,会出现如下错误消息。我在 Windows 10 上测试了这个项目,它工作正常。
CMakeLists.txt
cmake_minimum_required(VERSION 3.6)
project(flutter_openssl_crypto)
find_package(openssl REQUIRED CONFIG)
add_library(${PROJECT_NAME} SHARED empty.c)
target_link_libraries(${PROJECT_NAME} PRIVATE openssl::crypto)
错误
CMakeLists.txt:6 (find_package):
Could not find a package configuration file provided by "openssl" with any
of the following names:
opensslConfig.cmake
openssl-config.cmake
Add the installation prefix of "openssl" to CMAKE_PREFIX_PATH or set
"openssl_DIR" to a directory containing one of the above files. If
"openssl" provides a separate development package or SDK, be sure it has
been installed.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 5.3s
Exception: Gradle task assembleDebug failed with exit code 1
如何在 Ubuntu 上运行该项目?