c – LNK2005(已定义)
发布时间:2020-12-16 06:00:57 所属栏目:百科 来源:网络整理
导读:我知道你已经看到21728517人要求帮助这个人,但经过搜索和阅读后,我真的不能想出这一个.我知道这个错误,我以前看过,但是,这一次,我似乎无法摆脱它. 我也试过这个checklist. 所以,错误: Error 25 error LNK2005: "void __cdecl checkStatus(unsigned int ,cla
我知道你已经看到21728517人要求帮助这个人,但经过搜索和阅读后,我真的不能想出这一个.我知道这个错误,我以前看过,但是,这一次,我似乎无法摆脱它.
我也试过这个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)" (?checkStatus@@YAXAAIV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@_N@Z) already defined in DollarRecognizer.obj C:UsersRui TeixeiraDesktopCurrentTeseSVNTIFEE_EmptyTIFEE_Emptymain.obj TIFEE_Empty Error 26 error LNK2005: "void __cdecl depth2rgb(unsigned short const *,unsigned short *,char *,int,int)" (?depth2rgb@@YAXPBGPAGPADHH@Z) already defined in DollarRecognizer.obj C:UsersRui TeixeiraDesktopCurrentTeseSVNTIFEE_EmptyTIFEE_Emptymain.obj TIFEE_Empty Error 27 error LNK2005: "class std::vector<class std::basic_string<char,class std::allocator<class std::basic_string<char,class std::allocator<char> > > > __cdecl explode(class std::basic_string<char,char)" (?explode@@YA?AV?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@2@D@Z) already defined in DollarRecognizer.obj C:UsersRui TeixeiraDesktopCurrentTeseSVNTIFEE_EmptyTIFEE_Emptymain.obj TIFEE_Empty 所以,事情是,这些是在“misc.h”中用正确的#ifndef #define #endif定义的函数.他们没有在别处定义,但我仍然得到LNK2005的死亡.我究竟做错了什么? 提前致谢. 解决方法
定义misc.cpp中的函数,而不是在misc.h中.
问题可能是由于#include在多个CPP文件中的misc.h.头部保护装置防止在相同的翻译单元中多次包括标题,但是每个CPP文件(通常是)单独的翻译单元.所以这些功能最终被定义了两次 – 在每个翻译单元中一次. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |