Error compiling for Arduino Nano

Hi all, this is my first post here.

I'm trying to upload this sketch to an arduino nano but the compile process gives me the error below.
I didn't modify the sketch at all, just added the requested file 'PS2Mouse.h' to the same directory as the sketch file.
Not sure how to solve this.
Any help will be very appreciated.
Thanks

error code:

Arduino: 1.8.13 (Windows 10), Board: "Arduino Nano, ATmega328P"

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::PS2Mouse(int, int, int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::PS2Mouse(int, int, int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::clock_pin()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::data_pin()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::read_bit()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::pull_low(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::pull_high(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::write(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::read_byte()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::enable_data_reporting()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::disable_data_reporting()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::set_mode(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::set_remote_mode()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::set_stream_mode()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::set_scaling_2_1()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::set_scaling_1_1()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::set_sample_rate(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::set_resolution(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::read()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::read_movement_x(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::read_movement_y(int)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::report(int*)'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

libraries\PS2-Mouse-Arduino-master\PS2Mouse.cpp.o (symbol from plugin): In function `PS2Mouse::PS2Mouse(int, int, int)':

(.text+0x0): multiple definition of `PS2Mouse::initialize()'

sketch\PS2Mouse.cpp.o (symbol from plugin):(.text+0x0): first defined here

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Nano.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

It looks like you installed the PS2Mouse library and copied the code to the sketch's directory, so the IDE finds and compiles it twice.

pylon:
It looks like you installed the PS2Mouse library and copied the code to the sketch's directory, so the IDE finds and compiles it twice.

Thank you!!! I've deleted the files in the folder and it worked.
Thank you for your help.

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