PlatformIO error on startup under .vscode->c_cpp_properties.json

When I start VSCode and the PlatformIO extension on my Windows10 laptop, I see this in the “Problems” window:

Cannot find C:\Users\bruce.platformio\packages\framework-arduinoespressif8266\tools\sdk\libc\xtensa-lx106-elf\include

I don’t recall ever seeing these warnings before. Not only that, but, like I said I’m using Windows and it’s looking for “\libc\xtensa-lx106-elf\include”. I’m puzzled. Linux elf? And to top it all, there is NO libc subdirectory on my machine. How do I get rid of this error? I’m not sure if this is gumming up the works on a project where I want to get a Maxim-Dallas DS2482 I2C 1-wire master to work with an ESP8266. (BTW, it doesn’t make any difference which project folder I open, I get the same errors.) Not sure if its related but here are the errors I get trying to build the latter project:

> Executing task: C:\Users\Bruce\.platformio\penv\Scripts\platformio.exe run <

Processing d1_mini (platform: espressif8266; board: d1_mini; framework: arduino)
-----------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/d1_mini.html
PLATFORM: Espressif 8266 (3.0.0) > WeMos D1 R2 and mini
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
 - framework-arduinoespressif8266 3.30000.210519 (3.0.0)
 - tool-esptool 1.413.0 (4.13)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa 2.100200.0 (10.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 64 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <Wire> 1.0
Building in release mode
Linking .pio\build\d1_mini\firmware.elf
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1_mini\src\main.cpp.o:(.text.setup+0x8): undefined reference to `_ZN6DS24825resetEv'
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1_mini\src\main.cpp.o: in function `setup':  
main.cpp:(.text.setup+0x1b): undefined reference to `_ZN6DS24825resetEv'
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1_mini\src\main.cpp.o:(.text.loop+0x0): undefined reference to `_ZN6DS248210wireSearchEPh'
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1_mini\src\main.cpp.o:(.text.loop+0x4): undefined reference to `_ZN6DS248215wireResetSearchEv'
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1_mini\src\main.cpp.o: in function `loop':   
main.cpp:(.text.loop+0x16): undefined reference to `_ZN6DS248210wireSearchEPh'
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: main.cpp:(.text.loop+0x20): undefined reference to `_ZN6DS248215wireResetSearchEv'
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1_mini\src\main.cpp.o:(.text.startup._GLOBAL__sub_I_ds+0x0): undefined reference to `_ZN6DS2482C1Eh'
c:/users/bruce/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.2.0/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\d1_mini\src\main.cpp.o: in function `_GLOBAL__sub_I_ds':
main.cpp:(.text.startup._GLOBAL__sub_I_ds+0xe): undefined reference to `_ZN6DS2482C1Eh'        
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\d1_mini\firmware.elf] Error 1
================================= [FAILED] Took 24.13 seconds =================================The terminal process "C:\Users\Bruce\.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.

So, other ESP8266 projects DO build fine, but this has me completely baffled. 1) Why is PlatformIO looking for a non-existent “libc” directory?, 2) Why are there lx106-elf directories on my Windows10 machine in the first place?, and 3) why is it complaining about “undefined references” like the weirdly named `_ZN6DS248215wireResetSearchEv’ when “wireResetSearch” is, indeed, in the DS2482.cpp file under the project’s “lib” folder?? BTW, I’m no C++ expert or PlatformIO for that matter, but this is driving me nuts, so please forgive the rambling questions. Some hints please. Thanks.

Known warning per Problems with platformIO and seemingly missing file (ESP01-1M) that can be completely ignored since it does not affect building.

After demangling this is the DS2482::reset() function. Undefined reference means it did not find the actual implementation of that function. Looking at the

it shows that no dependency to the DS2482 was detected (but somehow still found the include path to it…). This probably means that the library is in the wrong place or not correctly included in the build system.

Please show your whole platformio.ini, folder structure and test code.

Thanks Max, for the assist! I’ll have to try the “demangler” in the future. So, here is the contents of my platformio.ini file:

[env:d1_mini]
platform = espressif8266
board = d1_mini
framework = arduino

And I have a feeling that you are going to tell me that I don’t specify the library (DS2482.cpp). I sort of thought that putting that file and the header file (DS2482.h) in the “lib” subdirectory of the project would suffice. Perhaps not. Here is the folder structure:
c:/Home/PlatformIO/Projects/1-wire/ESP8266-DS2482-OW-TEST
$ ls -lR
.:
total 1
drwxr-xr-x 1 Bruce 197609 0 Jun 17 14:16 include/
drwxr-xr-x 1 Bruce 197609 0 Jun 17 14:16 lib/
-rw-r–r-- 1 Bruce 197609 454 Jun 15 11:10 platformio.ini
drwxr-xr-x 1 Bruce 197609 0 Jun 15 11:11 src/
drwxr-xr-x 1 Bruce 197609 0 Jun 15 11:10 test/

./include:
total 8
-rw-r–r-- 1 Bruce 197609 3171 Jun 17 14:16 DS2482.h
-rw-r–r-- 1 Bruce 197609 1425 Jun 15 11:10 README

./lib:
total 12
-rw-r–r-- 1 Bruce 197609 5665 Jun 19 19:56 DS2482.cpp
-rw-r–r-- 1 Bruce 197609 1083 Jun 15 11:10 README

./src:
total 4
-rw-r–r-- 1 Bruce 197609 529 Jun 17 14:17 main.cpp

./test:
total 1
-rw-r–r-- 1 Bruce 197609 515 Jun 15 11:10 README

By “test code”, I’m assuming the source code in main.cpp, because, as you can see, I have nothing under /test for the project. At any rate, here is the main.cpp, directly from this GitHub site: paeae/Libraries/ds2482 at master · paeaetech/paeae · GitHub

#include <Arduino.h>
#include “DS2482.h”
#include <Wire.h>

DS2482 ds(0);

void setup()
{
Wire.begin();
ds.reset();
// configure DS2482 to use active pull-up instead of pull-up resistor
// configure returns 0 if it cannot find DS2482 connected
// if (!ds.configure(DS2482_CONFIG_APU))
// {
// Serial.print(“DS2482 not found\n”);
// }
}

void loop()
{
byte addr[8];
if ( !ds.wireSearch(addr))
{
// Serial.print(“No more addresses.\n”);
ds.wireResetSearch();
return;
}
}

Unfortunately, there were no clues as to how to get it working. I was also looking at this GitHub repo that was “based” on the former repo, but I didn’t have much luck compiling that one either. :frowning: . Thanks again, Max, for whatever tips you can offer.

The libray files must not be directly in lib/ but in a new library folder thererin, as the readme says.

Create a new folder lib/DS2482 and move the files include/DS2482.h and lib/DS2482.cpp into that new folder.

After that, do a build and everything should work. If the IntelliSense does not yet work, do a Ctrl+Shift+P → Rebuild IntelliSense to fix it.

You should also have a general read through the docs here and here and the library registry, though none of these options described therein are necessary if you follow the folder structure pointed out above.

Hi Max, thanks again for the healp. I completely spaced it (as in head space) not putting the DS2482 library and header in a separate folder, and now it compiles fine. So I have some RTFM’ing to do. Thanks again, I appreciate it very much. - Bruce