编译找不到 IOT_SOLUTION_PATH

Moderator: ESP_Bob

ESP32踩坑者1
Posts: 13
Joined: Mon Dec 20, 2021 4:34 pm

编译找不到 IOT_SOLUTION_PATH

Postby ESP32踩坑者1 » Mon Dec 20, 2021 5:06 pm

我使用 ESP-IOT-SOLUTION 时遇到了一个问题。编译时报错WARNING Can't detect IOT_SOLUTION_PATH in your environment...
按照官网的描述 我尝试添加环境变量 set IOT_SOLUTION_PATH=C:\esp\esp-iot-solution (我修改了路径,把IOT包放在了eps-idf目录下)
命令运行后没有任何反应 ESP-IDF生成的控制台 和 WIN10自带的控制台 我都试过了 没有用
在运行这条命令后 使用 set set IOT_SOLUTION_PATH 查询环境变量 并不能查到

最后手动添加了路径
%IOT_SOLUTION_PATH% 和 IOT_SOLUTION_PATH

大家不要笑,从某32转过来的,没有弄过ESP这种环境,没结果就乱弄。
在VSCODE里工程根目录的CMakeList文件(并不是main函数同级的拿一个list)里有这样的描述,我复制的例子

cmake_minimum_required(VERSION 3.5)

#If IOT_SOLUTION_PATH is not defined, use relative path as default value
if(NOT DEFINED ENV{IOT_SOLUTION_PATH})
get_filename_component(IOT_SOLUTION_PATH "${CMAKE_SOURCE_DIR}/../../../.." ABSOLUTE)
set(ENV{IOT_SOLUTION_PATH} ${IOT_SOLUTION_PATH})
message(WARNING "Can't detect IOT_SOLUTION_PATH in your environment, we infer it is $ENV{IOT_SOLUTION_PATH}")
endif()

# This example uses an extra component for common functions such as Wi-Fi and Ethernet connection.
set(EXTRA_COMPONENT_DIRS
$ENV{IOT_SOLUTION_PATH}/components/usb/tinyusb
$ENV{IOT_SOLUTION_PATH}/examples/common_components/boards
$ENV{IOT_SOLUTION_PATH}/components/bus
$ENV{IOT_SOLUTION_PATH}/components/button
$ENV{IOT_SOLUTION_PATH}/examples/common_components/boards/esp32-devkitc-v4)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include($ENV{IOT_SOLUTION_PATH}/component.cmake)
project(usb_wireless_disk)

我想问题就出现在 if(NOT DEFINED ENV{IOT_SOLUTION_PATH})上,那么请问我该怎么做?多谢!

dotdotchan
Posts: 1
Joined: Tue Jan 11, 2022 4:56 am

Re: 编译找不到 IOT_SOLUTION_PATH

Postby dotdotchan » Tue Jan 11, 2022 5:47 am

我前几天也是遇到这问题了 现在好像解决了
找到VSCODE 右下角 Win32的按钮 把鼠标放过去悬停会看到弹出显示C/C++设置的
然后单击一下这个win32 然后VSCODE上方会弹出win32的列表
上面有两个编辑设置的选项 一个UI 一个JSON 选那个都行
然后找到 includePath选项 加入 你想加的头文件路径
例如:
${workspaceFolder}/**
${IDF_TOOLS_PATH}/**
${IOT_SOLUTION_PATH}/**

Who is online

Users browsing this forum: No registered users and 71 guests