PhotonLibOS icon indicating copy to clipboard operation
PhotonLibOS copied to clipboard

curl.cpp:198:25: error: 'unique_ptr' is not a member of 'std'

Open faker2048 opened this issue 3 years ago • 1 comments
trafficstars

Describe Hi, I was interested in this project, so I attempted to compile it. However, compilation error arise when I build this repo. The compilation steps are described in full in the README.md file. I guess it may be caused by the problem of the compiler version.

/home/yxb/workspace/PhotonLibOS/net/curl.cpp:198:25: error: 'unique_ptr' is not a member of 'std'
  198 | static std::vector<std::unique_ptr<std::mutex>> mutex_buf;
      |                         ^~~~~~~~~~
/home/yxb/workspace/PhotonLibOS/net/curl.cpp:29:1: note: 'std::unique_ptr' is defined in header '<memory>'; did you forget to '#include <memory>'?
   28 | #include <photon/common/timeout.h>
  +++ |+#include <memory>
   29 | #include <photon/common/utility.h>

My version of tools : g++ (GCC) 11.3.0 cmake version 3.22.3

Solution Add #include <memory> to net/curl.cpp.

faker2048 avatar Jun 27 '22 01:06 faker2048

Thanks for reporting. There might be problems using higher version gcc, but of course, only trifles.

beef9999 avatar Jun 27 '22 04:06 beef9999