Hi there. I am using pio in vscode for an ESP32 project. The code compiles just fine on PC1 but not on PC2. Both are windows 10 64 bit. The first hints on what is going wrong are the error message, but also the dependency graph. The graph during compilation on PC2 is insanely long AND the library versions are different.
Here a small snippet of the graph:
| | |-- SD_control
| | | |-- FS @ 1.0
| | | |-- SD(esp32) @ 1.0.5
| | | | |-- FS @ 1.0
| | | | |-- SPI @ 1.0
| | | |-- SPI @ 1.0
| | |-- FS @ 1.0
| | |-- SD(esp32) @ 1.0.5
| | | |-- FS @ 1.0
| | | |-- SPI @ 1.0
| | |-- SPI @ 1.0
Although I do not have access to PC1 right now, I know that SPI was @ 2.0, same for FS and SD was also being @ 2.x.x. Although not visible in the snippet, the same goes for the wire library. The platformio.ini is identical for both:
[env:firebeetle32]
platform = espressif32
board = firebeetle32
framework = arduino
upload_port = COM5
lib_ldf_mode = chain+
build_flags = -I include
lib_deps =
256dpi/MQTT@^2.5.0
bblanchon/ArduinoJson@^6.17.3
paulstoffregen/Time@^1.6.1
adafruit/Adafruit ADS1X15@^2.2.0
adafruit/Adafruit BusIO@^1.9.3
From the PIO-Home section I can see, that the plattform version of espressif32 is 3.5.0 - I think that is the most recent one and I have them on both PCs - though I can double check later if necessary.
Finally, let’s come to the error message itself:
src/system_control.cpp: In function 'void setup()':
src/system_control.cpp:134:20: error: 'to_string' is not a member of 'std'
RTC_timestamp = std::to_string(RTC_time).c_str();
^
src/system_control.cpp:135:32: error: 'to_string' is not a member of 'std'
data_file_path = "/data/" + std::to_string(RTC_time) + "_" + string(MAC_str) + ".txt";
What I also noticed is, that I have a task.json file on PC2, what I do not have on PC1. I cant remember where it is coming from…Here the content:
{
"version": "2.0.0",
"tasks": [
{
"label": "debug",
"type": "shell",
"command": "",
"args": ["g++","-g", "${relativeFile}", "-o","a.exe"]
},
{
"label": "Compile and run",
"type": "shell",
"command": "",
"args": [
"g++","-g", "${relativeFile}", "-o","${fileBasenameNoExtension}.out", "&&", "clear" , "&&" , "./${fileBasenameNoExtension}.out"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
]
}
What I tryed:
- Delete .pio and .vscode folders and compiled
- Set C_Cpp.default.cppStandard to C++17
So I assume there is something wrong with the dependencies and lib versions - any idea how I can solve this? Is reinstallation the only way?