| title |
Compiler Error C2514 | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
error-reference |
| f1_keywords |
|
| dev_langs |
|
| helpviewer_keywords |
|
| ms.assetid |
4b7085e5-6714-4261-80b7-bc72e64ab3e8 |
| caps.latest.revision |
8 |
| author |
corob-msft |
| ms.author |
corob |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
'class' : class has no constructors
The class, structure, or union has no constructor with a parameter list that matches the parameters being used to instantiate it.
A class must be fully declared before it can be instantiated.
The following sample generates C2514:
// C2514.cpp
// compile with: /c
class f;
class g {
public:
g (int x);
};
class fmaker {
f *func1() {
return new f(2); // C2514
}
g *func2() {
return new g(2); // OK
}
};