[previous] 3480 [next] Object/function '%s', with internal linkage, has been defined in a header file.
Declarations and definitions

An object or function with internal linkage has been defined inside a header file. Header files usually contain macro definitions and declarations of typedefs, tags, objects and functions with external linkage. Conventionally, a header file is included in multiple translation units because its primary function is to provide a way of using such items throughout a project without code duplication.

An object or function should be defined in one translation unit only. It follows that such definitions should not be present in a header file except in the unusual situation where the header file is to be included in just one translation unit.

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents