cmake - 尝试通过 CMake 构建项目时出错
问题描述
我正在尝试通过 CMake 构建项目,几天前这个过程运行良好,但今天我在命令后收到错误 cmake -G "NMake Makefiles" ..
:
CMake Error at CMakeLists.txt:8 (project):
Running
'nmake' '-?'
failed with:
The system cannot find the specified file
-- Configuring incomplete, errors occurred!
我正在使用 Visual Studio Code,项目文件夹的名称是“ADC_read”,我的 CMakeLists.txt 文件是:
# Set minimum required version of CMake
cmake_minimum_required(VERSION 3.12)
# Include build functions from Pico SDK
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
# Set name of project (as PROJECT_NAME) and C/C standards
project(ADC_read C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# Creates a pico-sdk subdirectory in our project for the libraries
pico_sdk_init()
# Tell CMake where to find the executable source file
add_executable(${PROJECT_NAME}
main.c
)
# Create map/bin/hex/uf2 files
pico_add_extra_outputs(${PROJECT_NAME})
# Link to pico_stdlib (gpio, time, etc. functions)
target_link_libraries(${PROJECT_NAME}
pico_stdlib adc_read hardware_adc
)
# Enable usb output, disable uart output
pico_enable_stdio_usb(${PROJECT_NAME} 1)
pico_enable_stdio_uart(${PROJECT_NAME} 0)
有谁知道哪里有问题?
==========================% 编辑 %===================== ========== 半解决...
所以我仍然无法从Visual Studio Code构建项目(VSC 找不到 nmake
),但是从VS 命令提示符构建项目工作正常,所以我会坚持下去。
解决方案
推荐阅读
- php - 对 PHP 对象数组进行排序,使相邻对象不共享特定的属性值
- logging - 当 PAM 找到用户时,BRO 不记录 ssh
- python - 在圆环上生成随机点位置
- flask - 如何添加一份表格的多个副本并使用不同的数据提交它们?烧瓶,WTForms
- php - Codeigniter - Botman - 回复方法不起作用
- android - 从条形码扫描仪捕获键盘输入
- python - 使用 SMTP 和 Python 3 发送 xlsx 文件
- html - Headless Wordpress API:如何在 JSON 中删除 html
- arrays - 我可以使用数组属性创建自定义 PowerShell 对象吗?
- java - Java 8 流执行