Visual Studio 2012中的编译错误

Compilation Errors in Visual Studio 2012

本文关键字:编译 错误 Studio 2012 Visual      更新时间:2023-10-16

在过去的几个小时里,我一直在努力解决一个无法消除的错误。要点如下:https://gist.github.com/pluralism/11294490

我没有主意,因为一切对我来说都是正确的。我得到的编译错误如下:

1>MenuCAL.obj : error LNK2005: "void __cdecl printSquareArray(int * *,unsigned int)" (?printSquareArray@@YAXPAPAHI@Z) already defined in calproject.obj 1>C:UsersAndre PinheiroDesktopcalprojectDebugcalproject.exe : fatal error LNK1169: one or more multiply defined symbols found

如果您需要其他文件,请随时询问。提前感谢!

如果要在标头中定义printSquareArray,请将其标记为inline,以允许在包含标头的每个翻译单元中进行定义。

或者,将定义移动到源文件中,使其只定义一次。