怎么出现了未定义?
- C/C++ code
#include <boost/shared_ptr.hpp>#include <memory> #include <iostream>using namespace boost;int main() { boost::weak_ptr<int> wp0;//error C2079: “wp0”使用未定义的 class“boost::weak_ptr<Y>” //咋回事? //看了boost中有定义,怎么就不能使用呢?为啥? //前辈们多多指教,我是个新手。 return (0); } [解决办法]
weak_ptr.hpp
[解决办法]
你包含错误的头文件了