PlatformIO Community

About ADS1118 library compilation problem


#1

I downloaded an ADS1118 library from PlatFormio, compiled his example, and failed to compile. I do not know why. My hardware is arduino uno


#2

Please post full platformio.ini and the code you’re trying to compile.


#3


#4


#5


#6

Please remove [platformio] section at all. No need to do include_dir.


#8

OK Thank you for your answer ~~


#9

Did that fix it for you? I get a different error for the same library… with

[env:uno]
platform = atmelavr
board = uno
framework = arduino
lib_deps =
     ADS1118 library

Using example code https://platformio.org/lib/show/5833/ADS1118%20library/examples I get:

> Executing task in folder ADS1118_test: platformio run <

Processing uno (platform: atmelavr; board: uno; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR > Arduino Uno
HARDWARE: ATMEGA328P 16MHz 2KB RAM (31.50KB Flash)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 6 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SPI> 1.0
Compiling .pioenvs/uno/src/main.cpp.o
Archiving .pioenvs/uno/lib3d0/libSPI.a
src/main.cpp:1:21: fatal error: ADS1118.h: No such file or directory

*****************************************************************
* Looking for ADS1118.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ADS1118.h"
* Web  > https://platformio.org/lib/search?query=header:ADS1118.h
*
*****************************************************************

compilation terminated.
Indexing .pioenvs/uno/lib3d0/libSPI.a
Compiling .pioenvs/uno/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pioenvs/uno/FrameworkArduino/HardwareSerial0.cpp.o
*** [.pioenvs/uno/src/main.cpp.o] Error 1
=================================================== [ERROR] Took 0.85 seconds ===================================================
The terminal process terminated with exit code: 1

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


#11

Did not solve the problem, I created a new project and then modified the platformio.ini file to add the library file, then compile, and then an error, the IDE told me that he did not find the header file, I used include_dir and then no problem, but the compiler still Fail。


#12

Please provide a simple project to reproduce this issue.


#14

https://drive.google.com/open?id=1Ts86H5cUZq2WOfaLJRLMuFb4CrAtll0G

This is my ADS1118 project,


#15

I had to put build_flags = -I ".piolibdeps/ADS1118 library_ID5833" in my platformio.ini to make this go away… for some reason platformio just isn’t matching this library at all.


#17

Thank you for your answer. Open PlatformIO and re-create an Arduino project. Using this library, the compiler will report an error.I don’t know what it is because:rofl::rofl::rofl::rofl:


#18

Yeah, it’s either a bug in the library dependency matching, or in the config file for the library… either way, it’s install folder added to the include path as would normally happen, hence why it’s not being found, and the error given.