Skip to content

Latest commit

 

History

History
65 lines (58 loc) · 1.13 KB

compiler-error-c2514.md

File metadata and controls

65 lines (58 loc) · 1.13 KB
title Compiler Error C2514 | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-tools
ms.tgt_pltfrm
ms.topic error-reference
f1_keywords
C2514
dev_langs
C++
helpviewer_keywords
C2514
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

Compiler Error C2514

'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  
   }  
};