OneWire, VirtualWire compiling errors

Hello,
I tried to compile a sketch that was working a few years ago but now I got some compiling errors.

#include <SPI.h> // Serial Peripheral Interface 
#include <OneWire.h>
#include <VirtualWire.h>
#include <DallasTemperature.h>
#include <DS3232RTC.h>

I get these errors:

Arduino:1.8.13 (Windows Store 1.8.42.0) (Windows 10), Scheda:"Arduino Uno"

C:\Users\Luca\Documents\Arduino\libraries\OneWire-master\OneWire.cpp: In static member function 'static uint16_t OneWire::crc16(const uint8_t*, uint16_t, uint16_t)':

C:\Users\Luca\Documents\Arduino\libraries\OneWire-master\OneWire.cpp:554:15: error: '_crc16_update' was not declared in this scope

         crc = _crc16_update(crc, input[i]);

               ^~~~~~~~~~~~~

C:\Users\Luca\Documents\Arduino\libraries\OneWire-master\OneWire.cpp:554:15: note: suggested alternative: 'crc16_update'

         crc = _crc16_update(crc, input[i]);

               ^~~~~~~~~~~~~

               crc16_update

Più di una libreria trovata per "DS3232RTC.h"

Usata: C:\Users\Luca\Documents\Arduino\libraries\DS3232RTC

Non usata: C:\Users\Luca\Documents\Arduino\libraries\DS3232RTC-master

Più di una libreria trovata per "OneWire.h"

Usata: C:\Users\Luca\Documents\Arduino\libraries\OneWire-master

Non usata: C:\Users\Luca\Documents\Arduino\libraries\OneWire-2.3.5

exit status 1

Errore durante la compilazione per la scheda Arduino Uno.



Questo report potrebbe essere più ricco di informazioni abilitando l'opzione
"Mostra un output dettagliato durante la compilazione"
in "File -> Impostazioni"

I downloaded updated library...
Anybody knows how to solve?

Thank you very much.

Sincerly

Please post your full sketch code.

The code exeeds the maximum allowed lenght!

Let's consider this simple code:

#include <SPI.h> // Serial Peripheral Interface 
#include <VirtualWire.h>
#include <DallasTemperature.h>
#include <DS3232RTC.h>



void setup() {
 
  

}



void loop() {
  
delay (50);
} // loop()

I don't have the VirtualWire or DS3232RTC libraries installed. The minimal code below compiles (Board = Uno) for me. Try it:

#include <DallasTemperature.h>

void setup() {
}

void loop() {
}

There appears to be a conflict between the DS3232RTC library and the Dallas Temperature library:

"C:\\Users\\Jim\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10812 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\\Users\\Jim\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\cores\\arduino" "-IC:\\Users\\Jim\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\variants\\eightanaloginputs" "-IC:\\Users\\Jim\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\SPI\\src" "-IC:\\Users\\Jim\\Desktop\\Arduino\\libraries\\VirtualWire" "-IC:\\Users\\Jim\\Desktop\\Arduino\\libraries\\DallasTemperature" "-IC:\\Users\\Jim\\Desktop\\Arduino\\libraries\\OneWire" "-IC:\\Users\\Jim\\Desktop\\Arduino\\libraries\\DS3232RTC" "-IC:\\Users\\Jim\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.3\\libraries\\Wire\\src" "C:\\Users\\Jim\\AppData\\Local\\Temp\\arduino_build_944190\\sketch\\sketch_feb01a.ino.cpp" -o "C:\\Users\\Jim\\AppData\\Local\\Temp\\arduino_build_944190\\sketch\\sketch_feb01a.ino.cpp.o"
In file included from C:\Users\Jim\Desktop\Arduino\sketch_feb01a\sketch_feb01a.ino:4:0:

C:\Users\Jim\Desktop\Arduino\libraries\DS3232RTC/DS3232RTC.h:69:0: warning: "TEMP_MSB" redefined

 #define TEMP_MSB 0x11

 

In file included from C:\Users\Jim\Desktop\Arduino\sketch_feb01a\sketch_feb01a.ino:3:0:

C:\Users\Jim\Desktop\Arduino\libraries\DallasTemperature/DallasTemperature.h:40:0: note: this is the location of the previous definition

 #define TEMP_MSB        1

In file included from C:\Users\Jim\Desktop\Arduino\sketch_feb01a\sketch_feb01a.ino:4:0:

C:\Users\Jim\Desktop\Arduino\libraries\DS3232RTC/DS3232RTC.h:70:0: warning: "TEMP_LSB" redefined

 #define TEMP_LSB 0x12

 

In file included from C:\Users\Jim\Desktop\Arduino\sketch_feb01a\sketch_feb01a.ino:3:0:

C:\Users\Jim\Desktop\Arduino\libraries\DallasTemperature/DallasTemperature.h:39:0: note: this is the location of the previous definition

 #define TEMP_LSB        0

Maybe.
But in 2018 this code worked.
I need both libraries because I have a Real Time Clock and also some Temperature Sensors.

You will need to modify one of the libraries. You have the source code!

But I don't know what to modify !

Anyone has had the same problem?

But I don't know what to modify !

The error messages clearly say that both libraries define symbols with same name to mean different things, for example, the symbol "TEMP_MSB".

One approach would be to edit one of the libraries to use some name other than TEMP_MSB.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.