2014年4月8日

(转)如何解决VC中的警告warning C4251 needs to have dll-interface

摘要: 这通常是由于以数据成员方式在DLL导出类中使用了模板类造成的。比如:#include #include using namespace std;class __declspec( dllexport ) Test{public:std::vector m_objCon;};int main(){return 0;}这会导致这个警告:warning C4251: “Test::m_objCon”: class“std::vector”需要有 dll 接口由 class“Test”的客户端使用 1> with1> [1> _Ty=int1> ... 阅读全文

posted @ 2014-04-08 12:51 孤山独剑 阅读(493) 评论(0) 推荐(0) 编辑

导航