Deleting object files

Hi again!

I got an error message about ”multiple definition” of something. It looks like this:

sketch/Temperature.cpp.o:(.data.BytePlusMin+0x0): multiple definition of `BytePlusMin'
sketch/DisplayTest.ino.cpp.o:(.data.BytePlusMin+0x0): first defined here
collect2: error: ld returned 1 exit status

So it thinks I defined BytePlusMin twice. It's right about that it's defined in Temperature.cpp, but it's not defined in DisplayTest.ino. It was, but I moved it to temperature.cpp. So it seems like I need to remove those .o files, or at least one of them, but I can't find them. There is no sketch/ directory as far as I can see, and I can't find any .o-files. I have searched for those exact file names and I found nothing. What's going on here? Where are those .o-files located?

Operating system = Ubuntu 14.04.

It's in the temporary build folder. If you do File > Preferences > Show verbose output during: > compilation (check) and then do a compilation you should be able to examine the contents of the black console window at the bottom of the Arduino IDE window to find the location of the temporary build folder. For example from this line:

E:\ArduinoIDE\arduino-nightly\arduino-builder -dump-prefs -logger=machine -hardware E:\ArduinoIDE\arduino-nightly\hardware -hardware C:\Users\per\AppData\Local\Arduino15\packages -hardware E:\Stuff\misc\electronics\arduino\hardware -tools E:\ArduinoIDE\arduino-nightly\tools-builder -tools E:\ArduinoIDE\arduino-nightly\hardware\tools\avr -tools C:\Users\per\AppData\Local\Arduino15\packages -built-in-libraries E:\ArduinoIDE\arduino-nightly\libraries -libraries E:\Stuff\misc\electronics\arduino\libraries -fqbn=arduino:avr:uno -ide-version=10805 -build-path C:\Users\per\AppData\Local\Temp\arduino_build_566711 -warnings=all -build-cache C:\Users\per\AppData\Local\Temp\arduino_cache_677085 -prefs=build.warn_data_percentage=75\Users\per\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.1.1\ArduinoIDE\arduino-nightly\hardware\tools\avr\ArduinoIDE\arduino-nightly\hardware\tools\avr -verbose C:\Users\per\AppData\Local\Temp\untitled1503782534.tmp\sketch_sep16a\sketch_sep16a.ino

I can see that the temporary build folder for this compilation is set via:

-build-path C:\Users\per\AppData\Local\Temp\arduino_build_566711

If you find that folder and check the sketch subfolder you should find your .o file.

It's generally useful to know how to find the temporary build folder. Whether that will help you solve this specific problem is unsure.

The build folder should be deleted every time you exit the Arduino IDE so that's a faster, if less sure option.

Thanks, I found them in [b]/tmp/buildd0e2111a606ae222d284ef8e1fc4e468.tmp/sketch/[/b], but you were right. It didn’t solve my problem. At least I know where to look for the temporary files now. That can’t hurt… :slight_smile: