我知道你已经看到了21728517人,要求与这一个帮助,但搜索和阅读这之后我真的想不通这一个。我知道这个错误,但之前我已经看到过,但这一次,我似乎无法绕过它。LNK2005(已定义)
我也试过这个checklist。
因此,错误:
Error 25 error LNK2005: "void __cdecl checkStatus(unsigned int &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,bool)" ([email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected]) already defined in DollarRecognizer.obj C:\Users\Rui Teixeira\Desktop\Current\Tese\SVN\TIFEE_Empty\TIFEE_Empty\main.obj TIFEE_Empty
Error 26 error LNK2005: "void __cdecl depth2rgb(unsigned short const *,unsigned short *,char *,int,int)" ([email protected]@[email protected]) already defined in DollarRecognizer.obj C:\Users\Rui Teixeira\Desktop\Current\Tese\SVN\TIFEE_Empty\TIFEE_Empty\main.obj TIFEE_Empty
Error 27 error LNK2005: "class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > __cdecl explode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,char)" ([email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@[email protected][email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@@[email protected]@[email protected]@[email protected][email protected]@[email protected]@[email protected]@[email protected]@[email protected]@Z) already defined in DollarRecognizer.obj C:\Users\Rui Teixeira\Desktop\Current\Tese\SVN\TIFEE_Empty\TIFEE_Empty\main.obj TIFEE_Empty
所以,问题是,这些都是 “misc.h” 用正确的#ifndef的#define #ENDIF定义的功能。他们没有在其他地方定义,但我仍然得到了死亡的LNK2005。我究竟做错了什么?
在此先感谢。
#包含多个.cpp文件中的.h文件会触发此链接器错误。应该只有*一个*定义。你可以把*内联*放在它的前面。 –