Skip to content

Add example and augment C2200 page #5189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions docs/error-messages/compiler-errors-1/compiler-error-c2200.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
---
description: "Learn more about: Compiler Error C2200"
title: "Compiler Error C2200"
ms.date: "11/04/2016"
description: "Learn more about: Compiler Error C2200"
ms.date: "02/15/2025"
f1_keywords: ["C2200"]
helpviewer_keywords: ["C2200"]
ms.assetid: a04139a6-ce18-404b-9bfd-2369fc0af3cb
---
# Compiler Error C2200

'function' : function has already been defined
'function': function has already been defined

An [`alloc_text`](../../preprocessor/alloc-text.md) pragma uses a function name already defined. Ensure the `alloc_text` pragma appears after the function declaration but before its definition.

The following sample generates C2200:

An `alloc_text` pragma uses a function name already defined.
```cpp
// C2200.cpp
// compile with: /c
extern "C" void func() {}
#pragma alloc_text("section", func) // C2200
```