PhotonLibOS
PhotonLibOS copied to clipboard
curl.cpp:198:25: error: 'unique_ptr' is not a member of 'std'
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.
Thanks for reporting. There might be problems using higher version gcc, but of course, only trifles.