C++ VS2013编译器:';CObject::CObject';:无法访问类';CObject';

C++ VS2013编译器:';CObject::CObject';:无法访问类';CObject';,c++,c++11,mfc,C++,C++11,Mfc,我正试图在VisualStudio中将一个项目从迁移到c++11。我修复了许多问题,但还有一个问题我似乎无法用MFC解决: error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' (file.cpp) : see declaration of 'CObject::CObject' : see declaration of 'CObject' This diagnostic

我正试图在VisualStudio中将一个项目从迁移到c++11。我修复了许多问题,但还有一个问题我似乎无法用MFC解决:

error C2248: 'CObject::CObject' : cannot access private member declared in class 'CObject' (file.cpp)
: see declaration of 'CObject::CObject'
: see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CList<ParameterValue,ParameterValue &>::CList(const CList<ParameterValue,ParameterValue &> &)'
错误C2248:'CObject::CObject':无法访问在类'CObject'(file.cpp)中声明的私有成员
:参见“CObject::CObject”的声明
:参见“CObject”的声明
此诊断发生在编译器生成的函数“CList::CList(const-CList&)”中
这段代码在我们这方面没有改变,并且在针对VisualStudio2010工具集时编译得很好。据我所知,CObject的定义似乎也没有改变,这使它变得更加陌生

这里还有其他类似的问题,但我在那里找不到解决问题的方法。在大多数其他情况下,问题似乎来自缺少公共默认构造函数、复制构造函数或赋值运算符

但是,我们扩展CList的类提供了所有这些的公共版本,ParameterValue不从CObject继承

class __declspec(dllexport) GParameterValueList : public CList<ParameterValue, ParameterValue&>
{
// ParameterValue is a struct that DOES NOT inherit from CObject (or anything)
public:
    GParameterValueList();
    GParameterValueList(const GParameterValueList& SrcList);
    GParameterValueList& operator=(const GParameterValueList& SrcList);
}
class\uu declspec(dllexport)GParameterValueList:public CList
{
//ParameterValue是不从CObject(或任何内容)继承的结构
公众:
GParameterValueList();
GParameterValueList(常数GParameterValueList和SrcList);
GParameterValueList和operator=(常量GParameterValueList和SrcList);
}
任何帮助都将不胜感激

另外,我们的实现被导出到一个DLL中,我想知道这是否会导致一些冲突


编辑:不是重复的或->在这些中,CObject派生类缺少公共默认构造函数和复制构造函数。如上所述,我们的代码并非如此。

我认为问题出在ParameterValue类中。尝试在其中声明public构造函数,包括默认构造函数。 在我看来,CList试图在某个地方调用ParameterValue构造函数,但前者不能,因为后者是私有的

或者,尝试使用指针列表,如
CList


另一种选择是使用std容器而不是CList

GParameterValueList
copy构造函数是什么样子的?它是否有可能尝试委托给其基类的复制构造函数
CList
没有一个要委托给它。否,复制构造函数遍历另一个列表,复制每个参数值,然后将其推到当前列表的后面。普通构造函数不执行任何操作,运算符=执行的操作与复制构造函数几乎相同。在您未显示的代码中的某个地方,
CList
的复制构造函数正在被调用。找出地点和方式。