Best workaround for compiler error C2158: make_public does not support native template types
- 阅读更多 关于 Best workaround for compiler error C2158: make_public does not support native template types
问题 I have two c++/cli dlls (i.e. compiled with /clr) where A.dll references B.dll. In assembly B, I have a method, GetMgdClassB, I'd like to call from assembly A. Here is the code in assembly B (B.cpp): namespace B { public class NativeClassB { public: NativeClassB(); // ... }; public ref class MgdClassB { public: static MgdClassB ^ GetMgdClassB(const std::vector<NativeClassB *> & vecNativeBs) { // ... vecNativeBs; return gcnew MgdClassB(); } }; } Notice that the method GetMgdClassB takes a std: