xArm-Developer / xArm-CPLUS-SDK

C++ SDK for UFACTORY robots, 850, xArm5/6/7, and Lite6.
https://www.ufactory.cc/
BSD 3-Clause "New" or "Revised" License
44 stars 29 forks source link

Easy fixes to compile on MacOs Mojave #7

Closed supertwang closed 2 years ago

supertwang commented 3 years ago

I'm hoping these fixes can help someone. I was able to get the C++ SDK compiling on MacOS Mojave with a couple simple fixes to two files.

in src/xarm/core/os/network.cc: I added the following at line 42:

#if !defined(SOL_TCP) && defined(IPPROTO_TCP)
#define SOL_TCP IPPROTO_TCP
#endif
#if !defined(TCP_KEEPIDLE) && defined(TCP_KEEPALIVE)
#define TCP_KEEPIDLE TCP_KEEPALIVE
#endif

in the top Makefile, I changed

C_FLAGS = -std=c++0x -Wall -Wno-sign-compare -Wno-unused-variable -Wno-unused-but-set-variable -g -s $(C_DEFS) -I$(INC_DIR) $(LIBDIRS)
LIBS += -lm -lpthread -fPIC -shared

to

C_FLAGS = -std=c++0x -Wall -Wno-sign-compare -Wno-unused-variable -g $(C_DEFS) -I$(INC_DIR) $(LIBDIRS)
LIBS += -lm -lpthread -fPIC -shared -framework IOKit -framework CoreFoundation

This was enough for the full compile to complete. There are still a couple of warnings popping up, but they look minor.

supertwang commented 3 years ago

It should be noted, however, that I am not with the robot arm right now, so haven't tested these on the arm.

vimior commented 3 years ago

Hi @supertwang. Thank you very much for your suggestions and help, we will test and support mac system later.

MinnaZhong commented 2 years ago

Requirement Done-supports MacOs now.
Issue closed.