ATTiny85 Error, Pleas help

While programming a ATTiny to extend off another projcet using I2C (TinyWireS library) i got the following error:

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::USI_TWI_S()'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::USI_TWI_S()'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::begin(unsigned char)'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::send(unsigned char)'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::available()'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::receive()'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::onReceive(void (*)(unsigned char))'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `usi_onReceiverPtr'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `USI_TWI_S::onRequest(void (*)())'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `usi_onRequestPtr'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `TinyWireS_stop_check()'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `tws_delay(unsigned long)'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `TinyWireS'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

libraries\TinyWire\TinyWireSlave.cpp.o: In function `USI_TWI_S::USI_TWI_S()':

C:\Users\KarelKruger\AppData\Local\Arduino15\packages\digistump\hardware\avr\1.6.7\libraries\TinyWire/TinyWireSlave.cpp:27: multiple definition of `_onTwiDataRequest'

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

sketch\Wire.cpp.o: In function `TwoWire::write(unsigned char const*, unsigned int)':

sketch/Wire.cpp:227: undefined reference to `twi_transmit'

sketch\Wire.cpp.o: In function `TwoWire::write(unsigned char)':

sketch/Wire.cpp:209: undefined reference to `twi_transmit'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Digispark (Default - 16.5mhz)

any help will be greatly apprichiated

It looks like you might have some goofy stuff going on with your sketch:

KarelKruger:

sketch\TinyWireSlave.cpp.o:sketch/TinyWireSlave.cpp:27: first defined here

Do you have a file named TinyWireSlave.cpp in your sketch folder?

KarelKruger:

sketch\Wire.cpp.o: In function `TwoWire::write(unsigned char const*, unsigned int)':

Do you have a file named Wire.cpp in your sketch folder?

If the answer to the above questions is yes, then why?

pert:
It looks like you might have some goofy stuff going on with your sketch:Do you have a file named TinyWireSlave.cpp in your sketch folder?
Do you have a file named Wire.cpp in your sketch folder?

If the answer to the above questions is yes, then why?

Thanks for the reply Pert.

The TinyWireSlave.cpp was in the sketch folder.
The goofythings happend becaus the digispark items did not include drivers for the ATTiny85 to relay anything, this was solved by adding the following to preferences as well https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Glad to hear you got it working! In the future, when you want to put source files in the sketch folder you should use the #include "foo.h" syntax instead of #include <foo.h>. That will cause the sketch folder to be searched before the libraries folders for the file (the latter doesn’t check for the file in the sketch folder).