Livox-SDK / Livox-SDK2

Drivers for receiving LiDAR data and controlling lidar, support Lidar HAP and Mid-360.
Other
130 stars 88 forks source link

fixed build errors for arch linux #43

Closed k-ai0 closed 1 year ago

k-ai0 commented 1 year ago

Hi, I had some issues compiling this library on arch linux. I modified the following files and compiles perfectly fine.

+++ b/CMakeLists.txt
@@ -13,7 +13,10 @@ if (CMAKE_CROSSCOMPILING)
 endif()

 if (UNIX)
+       set(CMAKE_CXX_STANDARD 20)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64 -std=gnu++0x")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -std=gnu++0x")
 endif(UNIX)

and also the logger handler

+++ b/sdk_core/logger_handler/file_manager.h
@@ -28,6 +28,7 @@
 #include <string>
 #include <vector>
 #include <map>
+#include <cstdint>
k-ai0 commented 1 year ago

There were a few pragma warnings; but doubtful they were significant. Please advise if there is cause for concern.

/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/rapidjson.h:542:29: warning: unknown option after ‘#pragma GCC diagnostic’ kind [-Wpragmas]
  542 | #define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x))
      |                             ^~~~~~~
/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/rapidjson.h:543:34: note: in expansion of macro ‘RAPIDJSON_PRAGMA’
  543 | #define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x)
      |                                  ^~~~~~~~~~~~~~~~
/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/rapidjson.h:545:3: note: in expansion of macro ‘RAPIDJSON_DIAG_PRAGMA’
  545 |   RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W, x)))
      |   ^~~~~~~~~~~~~~~~~~~~~
/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/internal/dtoa.h:36:1: note: in expansion of macro ‘RAPIDJSON_DIAG_OFF’
   36 | RAPIDJSON_DIAG_OFF(array - bounds)  // some gcc versions generate wrong warnings
      | ^~~~~~~~~~~~~~~~~~
/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/rapidjson.h:542:29: note: did you mean ‘-Warray-bounds’?
  542 | #define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x))
      |                             ^~~~~~~
/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/rapidjson.h:543:34: note: in expansion of macro ‘RAPIDJSON_PRAGMA’
  543 | #define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x)
      |                                  ^~~~~~~~~~~~~~~~
/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/rapidjson.h:545:3: note: in expansion of macro ‘RAPIDJSON_DIAG_PRAGMA’
  545 |   RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W, x)))
      |   ^~~~~~~~~~~~~~~~~~~~~
/home/[redacted]/opt/Livox-SDK2/sdk_core/../3rdparty/rapidjson/internal/dtoa.h:36:1: note: in expansion of macro ‘RAPIDJSON_DIAG_OFF’
   36 | RAPIDJSON_DIAG_OFF(array - bounds)  // some gcc versions generate wrong warnings