如何在ESP32项目中加入libcurl
我的问题基本上是标题。
我的ESP32项目(我认为重要部分)的目录结构如下:
目录 | |
---|---|
.VSCODE | |
组件 | curl |
ESP32-Wifi-Manager | |
构建 | |
Main | Cmakelists.txt |
Main.C | |
.gitignore | |
cmakelists.txt | |
sdkconfig | |
sdkconfig.old |
我为包括libcurl所做的步骤是这些:
- git clone https://github.com/curl/curl/curl.git (进入组件文件夹)
- ,然后将2个文件移至curl目录
-lib/curl_config.h
-component.mk
请参阅 htttps://github.com.com /nkolban/esp32-snippets/tree/master/curl/build_files 或在相关视频中 https://www.youtube.com/watch? = tp4oc_kgmgu& t = 603s 。
我注意到的唯一差异是控制台和我们用来构建的命令。
我们使用“ ESP-IDF 4.4 CMD”和命令“ IDF.PY构建”。
这是控制台中的输出。
Executing action: all (aliases: build)
Running ninja in directory c:\users\name\desktop\project\mainproject\build
Executing "ninja all"...
[0/1] Re-running CMake...
-- ccache will be used for faster recompilation
-- Project is not inside a git repository, or git repository has no commits; will not use 'git describe' to determine PROJECT_VER.
-- Building ESP-IDF components for target esp32s2
CMake Error at C:/Espressif/frameworks/esp-idf-v4.4.1/tools/cmake/component.cmake:219 (message):
CMake Warning (dev) at build_properties.temp.cmake:7:
Syntax Warning in cmake code at column 51
Argument not separated from preceding token by whitespace.
Call Stack (most recent call first):
C:/Espressif/frameworks/esp-idf-v4.4.1/tools/cmake/scripts/component_get_requirements.cmake:3 (include)
This warning is for project developers. Use -Wno-dev to suppress it.
fatal: not a git repository (or any of the parent directories): .git
CMake Error at
C:/Users/name/Desktop/project/mainproject/components/curl/CMakeLists.txt:43
(include):
include could not find requested file:
Utilities
Call Stack (most recent call first):
C:/Espressif/frameworks/esp-idf-v4.4.1/tools/cmake/scripts/component_get_requirements.cmake:106 (include)
C:/Espressif/frameworks/esp-idf-v4.4.1/tools/cmake/scripts/component_get_requirements.cmake:124 (__component_get_requirements)
Call Stack (most recent call first):
C:/Espressif/frameworks/esp-idf-v4.4.1/tools/cmake/build.cmake:491 (__component_get_requirements)
C:/Espressif/frameworks/esp-idf-v4.4.1/tools/cmake/project.cmake:378 (idf_build_process)
CMakeLists.txt:6 (project)
-- Configuring incomplete, errors occurred!
在cmakelists.txt中,组件/卷曲/包含行似乎不起作用(例如实用程序)。
如果我们尝试一个绝对路径,而不是$ {cmake_current_source_dir}(请参见下方)稍后在“ project(curl c)”行中的错误。然后,错误说:“项目命令不可脚本可供脚本”。
cmake_minimum_required(VERSION 3.2...3.16 FATAL_ERROR)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake;${CMAKE_MODULE_PATH}")
include(Utilities)
include(Macros)
include(CMakeDependentOption)
include(CheckCCompilerFlag)
project(CURL C)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论