Compiling error windows 11 - only !

I have migrated to Windows 11 from window 10.
I used IDE 1.8.1.9 on my Win10 machine to compile my sketches.
I installed 1.8.1.9 on Win11 and copied all my sketches and libraries to the correct directory.
I then tried to compile an example from DS18B20 - Rob Tillaart Version 0.0.1 and got a compiling error as below. IDE thinks this is Win10 apart from anything else.
I tried the same example after installing IDE 2 and got the same result.
I re-installed 1.8.1.9 and updated all the libraries, same problem.

Any insight would be most welcome

ERROR CODE below

Arduino: 1.8.19 (Windows 10), Board: "Arduino Pro or Pro Mini, ATmega328P (5V, 16 MHz)"

C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\crust\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\crust\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries E:\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10819 -build-path C:\Users\crust\AppData\Local\Temp\arduino_build_675766 -warnings=none -build-cache C:\Users\crust\AppData\Local\Temp\arduino_cache_352061 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\crust\AppData\Local\Temp\arduino_modified_sketch_228086\DS18B20_simple.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\crust\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\crust\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries E:\Documents\Arduino\libraries -fqbn=arduino:avr:pro:cpu=16MHzatmega328 -ide-version=10819 -build-path C:\Users\crust\AppData\Local\Temp\arduino_build_675766 -warnings=none -build-cache C:\Users\crust\AppData\Local\Temp\arduino_cache_352061 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\crust\AppData\Local\Temp\arduino_modified_sketch_228086\DS18B20_simple.ino

Using board 'pro' from platform in folder: C:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Using core 'arduino' from platform in folder: C:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...

"C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\sketch\DS18B20_simple.ino.cpp" -o nul

Alternatives for OneWire.h: [OneWire@2.3.5]

ResolveLibrary(OneWire.h)

-> candidates: [OneWire@2.3.5]

"C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IE:\Documents\Arduino\libraries\OneWire" "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\sketch\DS18B20_simple.ino.cpp" -o nul

Alternatives for DS18B20.h: [DS18B20@0.1.0]

ResolveLibrary(DS18B20.h)

-> candidates: [DS18B20@0.1.0]

"C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IE:\Documents\Arduino\libraries\OneWire" "-IE:\Documents\Arduino\libraries\DS18B20\src" "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\sketch\DS18B20_simple.ino.cpp" -o nul

"C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IE:\Documents\Arduino\libraries\OneWire" "-IE:\Documents\Arduino\libraries\DS18B20\src" "E:\Documents\Arduino\libraries\OneWire\OneWire.cpp" -o nul

"C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IE:\Documents\Arduino\libraries\OneWire" "-IE:\Documents\Arduino\libraries\DS18B20\src" "E:\Documents\Arduino\libraries\DS18B20\src\DS18B20.cpp" -o nul

Generating function prototypes...

"C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IE:\Documents\Arduino\libraries\OneWire" "-IE:\Documents\Arduino\libraries\DS18B20\src" "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\sketch\DS18B20_simple.ino.cpp" -o "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\preproc\ctags_target_for_gcc_minus_e.cpp"

"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\preproc\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\Users\crust\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\crust\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IE:\Documents\Arduino\libraries\OneWire" "-IE:\Documents\Arduino\libraries\DS18B20\src" "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\sketch\DS18B20_simple.ino.cpp" -o "C:\Users\crust\AppData\Local\Temp\arduino_build_675766\sketch\DS18B20_simple.ino.cpp.o"

C:\Users\crust\AppData\Local\Temp\arduino_modified_sketch_228086\DS18B20_simple.ino: In function 'void setup()':

DS18B20_simple:26:10: error: 'class DS18B20' has no member named 'begin'

sensor.begin();

      ^~~~~

C:\Users\crust\AppData\Local\Temp\arduino_modified_sketch_228086\DS18B20_simple.ino: In function 'void loop()':

DS18B20_simple:32:10: error: 'class DS18B20' has no member named 'requestTemperatures'

sensor.requestTemperatures();

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

DS18B20_simple:34:18: error: 'class DS18B20' has no member named 'isConversionComplete'; did you mean 'doConversion'?

while (!sensor.isConversionComplete()); // wait until sensor is ready

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

              doConversion

Using library OneWire at version 2.3.5 in folder: E:\Documents\Arduino\libraries\OneWire

Using library DS18B20 at version 0.1.0 in folder: E:\Documents\Arduino\libraries\DS18B20

exit status 1

'class DS18B20' has no member named 'begin'

I moved your topic to an appropriate forum category @Crusty.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

It would seem you most probably have the wrong library. It's abominable, but there are many instances of multiple libraries with the same basic name. You'll have to look at your previous installation to see if you can determine the real library to use. I find it useful to keep a paper notebook where I track what exact libraries I'm installing.
And yeah, why did you post in a category that says not to post here?

I am most ashamed that I posted it in the wrong forum I can only blame being careless, sorry.

To answer your questionI copied all my sketches and libraries from my old machine so I would not exoect this to be an issue of the wrong one.

1 Like

There is no question that you have the wrong DS18B20 library. The issue is why.

It seems likely that on your old machine, you had two or more, and the compiler made the correct decision about which one to use.

The fix is completely obvious: delete the current DS18B20 library, and install the correct one.

Upon your advice I did a full Computer scan - all directories on my window 10 machine and found only one DS18B20 library which is the same as the current one on my windows 11 machine. However when I looked in the Win11 folder I found a sub folder/src which had a totally different versions of the .h and .ccp files with todays dates. Should I delete them ?

If you want your program to run, you must include the correct library. How you accomplish that is up to you.

I found a sub folder/src which had a totally different versions of the .h and .ccp files with todays dates

Where do you suppose those files came from?

I fixed the issue as follows. I renamed the DS18B20.h and DS18B20.cpp in the /src sub folder to .old and ran the sketch - DS18B20.h could not be found and didn't compile.

I then copied the original DS18B20.h and DS18B20.cpp to the /src folder and ran the sketch which worked fine.

I have no idea where the /src folder came from or the DS18B20.h and DS18B20.cpp within it.

Thanks for you help

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