0

I am currently working on a project that has files (generalFunctions.h and 1x generalFunctions.cpp) that are used by multiple .cpp files. In these files is written #include "generalFunctions.h"

However, I get an error: The functions were defined multiplied.

Can someone help me with this problem?

Greetings

Vlad from Moscow
  • 301,070
  • 26
  • 186
  • 335
Bamp
  • 25
  • 5
  • This can occur for several different reasons: A header included several times without guards, functions redefined in multiple files, function implemented in header... Can you add the full compilation messages so we can at least see where the error might come from? – Adalcar Feb 08 '21 at 17:17

1 Answers1

1

Function definitions must be excluded from a header file that is included in several compilation units provided that the functions are not declared with the specifier static or inline. Also you shall not include cpp files in other cpp files.

Vlad from Moscow
  • 301,070
  • 26
  • 186
  • 335