在做自己的程序時候,出現這個錯誤。

usr/include/c++/9/bits/shared_ptr.h:106:8: error: no type named ‘type’ in ‘struct std::enable_if<false, void>106 |  using _Constructible = typename enable_if<
      |        ^~~~~~~~~~~~~~
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp: In instantiation of ‘cv::Ptr<T>::Ptr(const false_type&, Y*) [with Y = const char; T = cv::Formatted; std::false_type = std::integral_constant<bool, false>]’:
/usr/local/include/opencv4/opencv2/core/cvstd_wrapper.hpp:103:57:   required from ‘cv::Ptr<T>::Ptr(Y*) [with Y = const char; T = cv::Formatted]’
/home/xiaopeng/webserver-test/epoll.cpp:154:38:   required from here
/usr/include/c++/9/bits/shared_ptr.h:129:7: note: candidate: ‘std::shared_ptr<_Tp>::shared_ptr(const std::shared_ptr<_Tp>&) [with _Tp = cv::Formatted]129 |       shared_ptr(const shared_ptr&) noexcept = default;
      |       ^~~~~~~~~~
/usr/include/c++/9/bits/shared_ptr.h:129:18: note:   no known conversion for argument 1 from ‘const char*’ to ‘const std::shared_ptr<cv::Formatted>&129 |       shared_ptr(const shared_ptr&) noexcept = default;
      |                  ^~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/shared_ptr.h:127:17: note: candidate: ‘constexpr std::shared_ptr<_Tp>::shared_ptr() [with _Tp = cv::Formatted]127 |       constexpr shared_ptr() noexcept : __shared_ptr<_Tp>() { }
      |                 ^~~~~~~~~~
/usr/include/c++/9/bits/shared_ptr.h:127:17: note:   candidate expects 0 arguments, 1 provided
make[2]: *** [CMakeFiles/webserver1.dir/build.make:76:CMakeFiles/webserver1.dir/epoll.cpp.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:83:CMakeFiles/webserver1.dir/all] 错误 2
make: *** [Makefile:91:all] 错误 2

找了半天,發現是print和printf的原因,
print是opencv自帶的方法,我的程序用了oepncv
using namespace cv;

所以沒有報錯。但是編譯的時候才會出現問題。
因爲我要用的是prtinf
std::printf()

就這一處沒使用std。結果搞了半天。
再次提醒,不要省略std。
尤其是在用notepad等編程序,儘量給所有變量和函數都綁定類,那麼即使出現bug,也能快速定位。