MySQL_Connector_Arduino icon indicating copy to clipboard operation
MySQL_Connector_Arduino copied to clipboard

'Ethernet' is ambiguous using QNEthernet.h

Open burtamus2003 opened this issue 2 years ago • 3 comments

I'm using the QNEthernet.h library on my Teensy 4.1 with Ethernet. As soon as I include the MySQL_Connection.h and compile it, it throws an error that 'Ethernet' is ambiguous. Any ideas would be appreciated.

myApp:312: error: reference to 'Ethernet' is ambiguous
             if (!Ethernet.begin()) {
                  ^
In file included from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Packet.h:44:0,
                 from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Connection.h:39,
                 from C:\Users\me\Documents\Arduino\myApp\myApp.ino:17:
C:\Users\me\Documents\Arduino\libraries\Ethernet\src/Ethernet.h:147:22: note: candidates are: EthernetClass Ethernet
 extern EthernetClass Ethernet;
                      ^

burtamus2003 avatar Sep 05 '22 22:09 burtamus2003

Hi,

It appears you may have another library with the same name. Find the duplicates and disable/remove the one you do not need. Or, more correctly, change the #include to include the correct Ethernet class. Removing the one you do not need is easier, though.

Dr. Bell

On Sep 5, 2022, at 6:36 PM, burtamus2003 @.***> wrote:

I'm using the QNEthernet.h library on my Teensy 4.1 with Ethernet. As soon as I include the MySQL_Connection.h and compile it, it throws an error that 'Ethernet' is ambiguous. Any ideas would be appreciated.

myApp:312: error: reference to 'Ethernet' is ambiguous if (!Ethernet.begin()) { ^ In file included from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Packet.h:44:0, from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Connection.h:39, from C:\Users\me\Documents\Arduino\myApp\myApp.ino:17: C:\Users\me\Documents\Arduino\libraries\Ethernet\src/Ethernet.h:147:22: note: candidates are: EthernetClass Ethernet extern EthernetClass Ethernet; ^

— Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SHYARQ7QPXDEXKOVJQXLV4ZYWRANCNFSM6AAAAAAQFKCBKM. You are receiving this because you are subscribed to this thread.

ChuckBell avatar Sep 05 '22 22:09 ChuckBell

So, let me get this straight. Just by “including” your library (a single line of code) that blows up my program, I have an issue with my code. It works perfectly fine without including your lib. Hmmmm Sent with auto-corruption from my iPhoneOn Sep 5, 2022, at 17:40, Dr. Charles Bell @.***> wrote: Hi,

It appears you may have another library with the same name. Find the duplicates and disable/remove the one you do not need. Or, more correctly, change the #include to include the correct Ethernet class. Removing the one you do not need is easier, though.

Dr. Bell

On Sep 5, 2022, at 6:36 PM, burtamus2003 @.***> wrote:

I'm using the QNEthernet.h library on my Teensy 4.1 with Ethernet. As soon as I include the MySQL_Connection.h and compile it, it throws an error that 'Ethernet' is ambiguous. Any ideas would be appreciated.

myApp:312: error: reference to 'Ethernet' is ambiguous if (!Ethernet.begin()) { ^ In file included from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Packet.h:44:0, from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Connection.h:39, from C:\Users\me\Documents\Arduino\myApp\myApp.ino:17: C:\Users\me\Documents\Arduino\libraries\Ethernet\src/Ethernet.h:147:22: note: candidates are: EthernetClass Ethernet extern EthernetClass Ethernet; ^

— Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SHYARQ7QPXDEXKOVJQXLV4ZYWRANCNFSM6AAAAAAQFKCBKM. You are receiving this because you are subscribed to this thread.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

burtamus2003 avatar Sep 19 '22 01:09 burtamus2003

No, it means you have to decide which Ethernet library you want to use. Read the code and documentation concerning modifying the code to adapt it to your platform. I do not have a Teensy board else I’d try it myself. Hint: see the #include in the connector code. Fix that first.

Sent from my iPad

On Sep 18, 2022, at 21:01, burtamus2003 @.***> wrote:

 So, let me get this straight. Just by “including” your library (a single line of code) that blows up my program, I have an issue with my code. It works perfectly fine without including your lib. Hmmmm Sent with auto-corruption from my iPhoneOn Sep 5, 2022, at 17:40, Dr. Charles Bell @.***> wrote: Hi,

It appears you may have another library with the same name. Find the duplicates and disable/remove the one you do not need. Or, more correctly, change the #include to include the correct Ethernet class. Removing the one you do not need is easier, though.

Dr. Bell

On Sep 5, 2022, at 6:36 PM, burtamus2003 @.***> wrote:

I'm using the QNEthernet.h library on my Teensy 4.1 with Ethernet. As soon as I include the MySQL_Connection.h and compile it, it throws an error that 'Ethernet' is ambiguous. Any ideas would be appreciated.

myApp:312: error: reference to 'Ethernet' is ambiguous if (!Ethernet.begin()) { ^ In file included from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Packet.h:44:0, from C:\Users\me\Documents\Arduino\libraries\MySQL_Connector_Arduino\src/MySQL_Connection.h:39, from C:\Users\me\Documents\Arduino\myApp\myApp.ino:17: C:\Users\me\Documents\Arduino\libraries\Ethernet\src/Ethernet.h:147:22: note: candidates are: EthernetClass Ethernet extern EthernetClass Ethernet; ^

— Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/192, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SHYARQ7QPXDEXKOVJQXLV4ZYWRANCNFSM6AAAAAAQFKCBKM. You are receiving this because you are subscribed to this thread.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***> — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

ChuckBell avatar Sep 19 '22 01:09 ChuckBell