Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: OneWire library stopped compiling

  1. #1
    Junior Member
    Join Date
    Feb 2018
    Posts
    2

    OneWire library stopped compiling

    I have had a temperature monitoring project running since November 2017 using two DS18B20 sensors. The code no longer compiles. Here is my project code:

    Here is my project code. It has been working since November 2017:
    D1S_Attic_Monitor_UV_control.ino

    For working project see: https://thingspeak.com/channels/64954

    I've tried using OneWire library versions back to 2.3.0 with similar errors. Here is the IDE message with version 2.3.3:


    Arduino: 1.8.5 (Windows 10), Board: "WeMos D1 R2 & mini, 80 MHz, 4M (1M SPIFFS), v2 Prebuilt (MSS=536), Disabled, None, 921600"

    Build options changed, rebuilding all
    Archiving built core (caching) in: C:\Users\Karl\AppData\Local\Temp\arduino_cache_926 424\core\core_esp8266_esp8266_d1_mini_CpuFrequency _80,FlashSize_4M1M,LwIPVariant_v2mss536,Debug_Disa bled,DebugLevel_None____,UploadSpeed_921600_90f166 b225a978298447140629ed3119.a
    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::depower()':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:163: multiple definition of `OneWire::reset()'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:163: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::search(unsigned char*, bool)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:197: multiple definition of `OneWire::write_bit(unsigned char)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:197: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::read_bit()':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:225: multiple definition of `OneWire::read_bit()'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:225: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::write(unsigned char, unsigned char)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:249: multiple definition of `OneWire::write(unsigned char, unsigned char)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:249: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::write_bytes(unsigned char const*, unsigned short, bool)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:263: multiple definition of `OneWire::write_bytes(unsigned char const*, unsigned short, bool)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:263: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::read()':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:277: multiple definition of `OneWire::read()'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:277: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::read_bytes(unsigned char*, unsigned short)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:287: multiple definition of `OneWire::read_bytes(unsigned char*, unsigned short)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:287: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::select(unsigned char const*)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:296: multiple definition of `OneWire::select(unsigned char const*)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:296: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::skip()':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:308: multiple definition of `OneWire::skip()'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:308: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::depower()':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:314: multiple definition of `OneWire::depower()'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:314: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::reset_search()':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:328: multiple definition of `OneWire::reset_search()'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:328: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::OneWire(unsigned char)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:145: multiple definition of `OneWire::OneWire(unsigned char)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:145: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::OneWire(unsigned char)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:145: multiple definition of `OneWire::OneWire(unsigned char)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:145: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::target_search(unsigned char)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:343: multiple definition of `OneWire::target_search(unsigned char)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:343: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::search(unsigned char*, bool)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:368: multiple definition of `OneWire::search(unsigned char*, bool)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:368: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::crc8(unsigned char const*, unsigned char)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:526: multiple definition of `OneWire::crc8(unsigned char const*, unsigned char)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:526: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::crc16(unsigned char const*, unsigned short, unsigned short)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:568: multiple definition of `OneWire::crc16(unsigned char const*, unsigned short, unsigned short)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:568: first defined here

    libraries\DallasTemperature\OneWire.cpp.o: In function `OneWire::check_crc16(unsigned char const*, unsigned short, unsigned char const*, unsigned short)':

    C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature/OneWire.cpp:562: multiple definition of `OneWire::check_crc16(unsigned char const*, unsigned short, unsigned char const*, unsigned short)'

    libraries\OneWire\OneWire.cpp.o:C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire/OneWire.cpp:562: first defined here

    collect2.exe: error: ld returned 1 exit status

    Multiple libraries were found for "OneWire.h"
    Used: C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire
    Not used: C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature
    exit status 1
    Error compiling for board WeMos D1 R2 & mini.

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,576
    Quote Originally Posted by W4KRL View Post
    Multiple libraries were found for "OneWire.h"
    Used: C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\OneWire
    Not used: C:\Users\Karl\Box Sync\Box Sync\Arduino\libraries\DallasTemperature
    Some copies of DallasTemperature contain a copy of OneWire. If you have one of those, the problem is DallasTemperature. Either uninstall OneWire, or edit DallasTemperature to delete OneWire, or find a better copy of DallasTemperature.

    If that doesn't fix the problem, try compiling for Arduino Uno or Teensy. If the problem happens with these supported boards, please submit an issue on github. Those are the only "supported" hardware. If the problem only happens on ESP, as on the ESP community forums. That is the right place for ESP-only problems.

  3. #3
    Junior Member
    Join Date
    Feb 2018
    Posts
    2
    Paul,

    Thanks so much!!! Commenting out the include for OneWire.h solved the problem.

    That was fast!

    Karl

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,576
    Please find the issue or otherwise contact the author of DallasTemperature.

    This is a known problem, but it's unlikely to ever get fixed unless more people complain....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •