缺少头文件导致编译不通过 #238

Open
opened 2025-02-26 14:27:01 +01:00 by lunarifish · 2 comments
lunarifish commented 2025-02-26 14:27:01 +01:00 (Migrated from github.com)
  • OS: Ubuntu 22.04 (parallels vm)

    • gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

    • GNU Make 4.3 (Built for aarch64-unknown-linux-gnu)

    • cmake version 3.22.1

    • libstdc++-12-dev/jammy-updates,jammy-security,now 12.3.0-1ubuntu1~22.04 arm64

In file included from /home/parallels/Livox-SDK/sdk_core/src/base/thread_base.cpp:25:
/home/parallels/Livox-SDK/sdk_core/src/base/thread_base.h:46:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type
   46 |   std::shared_ptr<std::thread> thread_;
      |        ^~~~~~~~~~
/home/parallels/Livox-SDK/sdk_core/src/base/thread_base.h:30:1: note: ‘std::shared_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include <memory>’?
   29 | #include "noncopyable.h"
  +++ |+#include <memory>
   30 | 

按提示添加#include 后解决

- OS: Ubuntu 22.04 (parallels vm) - gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 - GNU Make 4.3 (Built for aarch64-unknown-linux-gnu) - cmake version 3.22.1 - libstdc++-12-dev/jammy-updates,jammy-security,now 12.3.0-1ubuntu1~22.04 arm64 ``` In file included from /home/parallels/Livox-SDK/sdk_core/src/base/thread_base.cpp:25: /home/parallels/Livox-SDK/sdk_core/src/base/thread_base.h:46:8: error: ‘shared_ptr’ in namespace ‘std’ does not name a template type 46 | std::shared_ptr<std::thread> thread_; | ^~~~~~~~~~ /home/parallels/Livox-SDK/sdk_core/src/base/thread_base.h:30:1: note: ‘std::shared_ptr’ is defined in header ‘<memory>’; did you forget to ‘#include <memory>’? 29 | #include "noncopyable.h" +++ |+#include <memory> 30 | ``` 按提示添加#include <memory>后解决
xushichao123456 commented 2025-04-26 11:04:24 +02:00 (Migrated from github.com)

我去,我卡了好久,一直以为是thread报错,搞了半天g++版本,原来是这样

我去,我卡了好久,一直以为是thread报错,搞了半天g++版本,原来是这样
neolu commented 2026-02-07 02:38:23 +01:00 (Migrated from github.com)
c++ STANDARD https://github.com/neolu/Livox-SDK
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mmr/Livox-SDK#238