Can't use Dynamixel SDK on Raspberry PI

I have ordered XM430-W350-R servos, but they have not arrived yet. I wanted to set up everything so that it will work as soon as they arrive. I cloned the Github SDK repo, and I will be using C on a Raspberry PI 4B. However, when I go to DynamixelSDK/c/build/linux_sbc and run “make” in the terminal, it doesn’t build. I get a bunch of “multiple definition” errors, such as this one:

/usr/bin/ld: ./.objects/packet_handler.o:/home/user_name/DynamixelSDK/c/build/linux_sbc/../../include/dynamixel_sdk/port_handler.h:47: multiple definition of `g_used_port_num'; 
./.objects/group_bulk_read.o:/home/user_name/DynamixelSDK/c/build/linux_sbc/../../include/dynamixel_sdk/port_handler.h:47: first defined here

When I run the corresponding make command on my mac (from DynamixelSDK/c/build/mac) it works fine. Why doesn’t it work on the Raspberry PI?

EDIT: I fixed the issue. The problem was that the variables defined in packet_handler.h:82, port_handler.h:47 and port_handler.h:48 became redefined in different source file. By declaring each of those variables as extern, the problem was fixed and I can now compile and link the files. Robotis should change this in the SDK, so that no one else has to sit through and debug it like I had to.

I used the video/procedures mentioned at this “QuickStart” post and I did not have any problem at all with an RPi-4B. I did compile both for C and C++, although so far, I only used C++.

I used the above procedures in this project which worked out OK for me (I did use C++ though).