Hi all -
I've been running VS Code with the ESP-IDF extension on a VirtualBox client for a couple months now. For whatever reason, I've found it very hard to flash a device through VB, so I want to try using VS Code in Windows.
I did a fresh install of the IDF (and tools, etc), and cloned my project from bitbucket. When I try to build, though, I get some errors:
Can someone tell me what I'm doing wrong? Was it a mistake to try to reuse my Linux .vscode files?
Thanks...
changing from Linux to Windows
-
- Posts: 229
- Joined: Wed May 02, 2018 12:12 pm
Re: changing from Linux to Windows
Well there are several things here as mentioned in the Problems tab:
Environment variables are referenced different in Windows than Linux. For a cross platform approach, try to use for example .
The compiler path is different in Windows. Check your ESP-IDF setup location for xtensa-esp32-elf-gcc. Something like
compile_commands.json probably doesn't exist if you haven't built your project yet.
Environment variables are referenced different in Windows than Linux. For a cross platform approach, try to use
Code: Select all
${env:<var>}
Code: Select all
${env:IDF_PATH}
The compiler path is different in Windows. Check your ESP-IDF setup location for xtensa-esp32-elf-gcc. Something like
Code: Select all
C:\\.espressif\\tools\xtensa-esp32-elf\\{version}\\xtensa-esp32-elf\\bin\\xtensa-esp32-elf-gcc
Re: changing from Linux to Windows
Hi bignacio -
Thanks for the information; I did find the template in the docs for the file, and it now looks like this:
It now behaves much better, but I think I need to add the path to the system includes (found in my .espressif/tools folder), because the IDE is telling me it can't find files like stdlib.h, stddef.h, etc.
Do I need to hard-code those paths in this file, or is there a notation analogous to the ${env:IDF_PATH} you mentioned below?
Thanks...
Thanks for the information; I did find the template in the docs for the file, and it now looks like this:
Code: Select all
{
"configurations": [
{
"name": "ESP-IDF",
"cStandard": "c11",
"cppStandard": "c++17",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}
Do I need to hard-code those paths in this file, or is there a notation analogous to the ${env:IDF_PATH} you mentioned below?
Thanks...
-
- Posts: 229
- Joined: Wed May 02, 2018 12:12 pm
Re: changing from Linux to Windows
I would recommend to add compilerPath to xtensa's gcc for the C/C++ extension to pick up basic c libraries and use the compile_commands.json if you are able to build successfully for more accuracy.
Re: changing from Linux to Windows
Hi bignacio -
I did this:
Still get errors.
What exactly would I do with compile_commands.json?
Thanks!
I did this:
Code: Select all
{
"configurations": [
{
"name": "ESP-IDF",
"cStandard": "c11",
"cppStandard": "c++17",
"includePath": [
"${config:idf.espIdfPath}/components/**",
"${config:idf.espIdfPathWin}/components/**",
"C:/Users/mzimmers/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/xtensa-esp32-elf/**",
"C:/Users/mzimmers/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/lib/gcc/xtensa-esp32-elf/8.4.0/include/**",
"${workspaceFolder}/**"
],
"browse": {
"path": [
"${config:idf.espIdfPath}/components",
"${config:idf.espIdfPathWin}/components",
"${workspaceFolder}/**"
],
"limitSymbolsToIncludedHeaders": false
}
}
],
"version": 4
}
What exactly would I do with compile_commands.json?
Thanks!
Who is online
Users browsing this forum: No registered users and 22 guests