Project libraries not found

Hi

I have Platform Io ver 4.2.1 and I have a problem when I install libraries in platformio in global folder or in the project folder the software does not detect it.

This happen to any library not just below example.
Ex: #include <SoftwareI2C.h>
Error: SoftwareI2C.h: No such file or directory

I even add this to platformio.ini lib dependence no lock, even I copy the library to pio/libdeos.

The only way I can make this work is by adding the library to the src folder, but the problem is dependent libries not found.

The preferred way to use libraries is to declare them in platformio.ini like so:

lib_deps =
    SoftwareI2C

If this doesn’t work, post your platformio.ini file and the full log output of the build task.

Thanks for the replay, here is my platformio.ini

[env:nanoatmega328new]
platform = atmelavr
board = nanoatmega328new
framework = arduino
lib_deps = SoftwareI2C

and I do not know what do you mean by log but this the error:

Processing nanoatmega328new (platform: atmelavr; board: nanoatmega328new; framework: arduino)
 
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/nanoatmega328new.html
PLATFORM: Atmel AVR 2.0.0 > Arduino Nano ATmega328 (New Bootloader)
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 30KB Flash

PACKAGES:
 - framework-arduino-avr 5.0.0
 - toolchain-atmelavr 1.50400.190710 (5.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 22 compatible libraries
Scanning dependencies...
  
Dependency Graph
|-- <Adafruit ADS1X15> 1.1.0
|   |-- <Wire> 1.0
|-- <EEPROM> 2.0
|-- <Wire> 1.0
Building in release mode

Compiling .pio\build\nanoatmega328new\src\Comm.cpp.o
Compiling .pio\build\nanoatmega328new\src\main.cpp.o
Archiving .pio\build\nanoatmega328new\libdab\libWire.a
Archiving .pio\build\nanoatmega328new\lib957\libAdafruit ADS1X15_ID342.a
Compiling .pio\build\nanoatmega328new\FrameworkArduino\Print.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\Stream.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\Tone.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\USBCore.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\WInterrupts.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\WMath.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\WString.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\abi.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\hooks.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\main.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\new.cpp.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring.c.o
Compiling .pio\build\nanoatmega328new\FrameworkArduino\wiring_analog.c.o

In file included from src\Comm.cpp:9:0:
src\Comm.h:16:25: fatal error: SoftwareI2C.h: No such file or directory
 
*********************************************************************
* Looking for SoftwareI2C.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SoftwareI2C.h"
* Web  > https://platformio.org/lib/search?query=header:SoftwareI2C.h
*
*********************************************************************
 
compilation terminated.
In file included from src\main.cpp:2:0:
src/Comm.h:16:25: fatal error: SoftwareI2C.h: No such file or directory
 
*********************************************************************
* Looking for SoftwareI2C.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:SoftwareI2C.h"
* Web  > https://platformio.org/lib/search?query=header:SoftwareI2C.h
*
*********************************************************************
 
compilation terminated.
*** [.pio\build\nanoatmega328new\src\Comm.cpp.o] Error 1
*** [.pio\build\nanoatmega328new\src\main.cpp.o] Error 1

I just figured out that the SoftwareI2C library I proposed is for the Mbed framework only, not for Arduino. That’s why it’s ignored by PlatformIO.

Which library did you want to use? Do you have a link to its repository?

1 Like

I even try to #include <SoftWire.h> same thing

Okay I figure it out, it has to install on the project does not work on globally anymore

1 Like

Er? I don’t think so… if you’re trying to use PlatformIO Registry … as Manuel said… that is a mbed only library, and NOT arduino compatible… so perhaps you used a different library such as GitHub - felias-fogg/SoftI2CMaster: Software I2C Arduino library or GitHub - stevemarple/SoftWire: Software I2C implementation for Arduino and other Wiring-type environments ?