MCUdude / MegaCore

Arduino hardware package for ATmega64, ATmega128, ATmega165, ATmega169, ATmega325, ATmega329, ATmega640, ATmega645, ATmega649, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega3250, ATmega3290, ATmega6450, ATmega6490, AT90CAN32, AT90CAN64 and AT90CAN128
Other
374 stars 115 forks source link

cannot be compiled when using the Wire library #207

Closed vanduy10061991 closed 8 months ago

vanduy10061991 commented 9 months ago

D:\ideV8\portable\sketchbook\libraries\Wire\Wire.cpp: In member function 'void TwoWire::begin()': D:\ideV8\portable\sketchbook\libraries\Wire\Wire.cpp:62:3: error: 'DIDR0' was not declared in this scope DIDR0 &= 0xCF; ^~~~~ D:\ideV8\portable\sketchbook\libraries\Wire\Wire.cpp:62:3: note: suggested alternative: 'OCDR0' DIDR0 &= 0xCF; ^~~~~ OCDR0 Multiple libraries were found for "Wire.h" Used: D:\ideV8\portable\sketchbook\libraries\Wire Not used: D:\ideV8\portable\packages\MegaCore\hardware\avr\2.2.3\libraries\Wire exit status 1 Error compiling for board ATmega128.

MCUdude commented 9 months ago

Have a look at the error message. The IDE is using the wrong Wire library

vanduy10061991 commented 9 months ago

How can I select the Megacore hardware library when compiling it? It does not choose the hardware library itself but runs the default library

MCUdude commented 9 months ago

Remove the library it uses instead. Then it will switch back to the one provided by MegaCoee

vanduy10061991 commented 9 months ago

I tried that and it worked, but when I compiled it for another MCU, it gave me an error that it couldn't compile

MCUdude commented 8 months ago

Well, that's not MegaCore's problem...

If you have two conflicting libraries, you'll have to deal with it some how. I suggest renaming the modified one.