Tôi biết bạn đã thấy 21728517 người yêu cầu trợ giúp về vấn đề này nhưng sau khi tìm kiếm và đọc về điều này tôi thực sự không thể tìm ra điều này. Tôi biết lỗi này, tôi đã nhìn thấy nó trước đây, tuy nhiên, lần này, tôi không thể có vẻ để có được xung quanh nó.LNK2005 (đã được xác định)
Tôi cũng đã thử điều này checklist.
Vì vậy, các lỗi:
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
Vì vậy, vấn đề là, đây là những chức năng được xác định trong "misc.h" với #endif #ifndef #define thích hợp. Chúng không được xác định ở nơi khác nhưng tôi vẫn nhận được cái chết của LNK2005. Tôi đang làm gì sai?
Xin cảm ơn trước.
#including tệp .h trong nhiều tệp .cpp sẽ kích hoạt lỗi trình liên kết này. Chỉ nên có * một * định nghĩa. Bạn có thể đặt * inline * ở phía trước nó. –