이전 프로젝트를 VS6에서 VS2005로 변환하는 데 문제가 있습니다. 코드의 한 위치에서 variant_t 유형을 사용하므로이 목적을 위해 comdef.h가 포함됩니다.VS2005 MFC 응용 프로그램에서 <comdef.h>을 포함한 C++ 컴파일러 문제
c:\program files\microsoft visual studio 8\vc\include\comutil.h(978) : error C2535: '_variant_t::_variant_t(int) throw()' : member function already defined or declared
c:\program files\microsoft visual studio 8\vc\include\comutil.h(970) : see declaration of '_variant_t::_variant_t'
c:\program files\microsoft visual studio 8\vc\include\comutil.h(1007) : error C2535: '_variant_t::operator int(void) const' : member function already defined or declared
c:\program files\microsoft visual studio 8\vc\include\comutil.h(998) : see declaration of '_variant_t::operator int'
c:\program files\microsoft visual studio 8\vc\include\comutil.h(1037) : error C2535: '_variant_t &_variant_t::operator =(int)' : member function already defined or declared
c:\program files\microsoft visual studio 8\vc\include\comutil.h(1029) : see declaration of '_variant_t::operator ='
c:\program files\microsoft visual studio 8\vc\include\comutil.h(1331) : error C2084: function '_variant_t::_variant_t(int) throw()' already has a body
c:\program files\microsoft visual studio 8\vc\include\comutil.h(970) : see previous definition of '{ctor}'
c:\program files\microsoft visual studio 8\vc\include\comutil.h(1588) : error C2084: function '_variant_t::operator int(void) const' already has a body
c:\program files\microsoft visual studio 8\vc\include\comutil.h(998) : see previous definition of '.H'
c:\program files\microsoft visual studio 8\vc\include\comutil.h(2006) : error C2084: function '_variant_t &_variant_t::operator =(int)' already has a body
c:\program files\microsoft visual studio 8\vc\include\comutil.h(1029) : see previous definition of '='
아마 일부가 누락 정의하거나 일부는 내가 포함해야 파일을 포함하지만 난 찾을 수가 없어, 잘못 일부 구성이 있습니다 : comdef.h 다음 날 위해 이러한 오류를 생성하는 comutil.h을 포함 문제.
#define long int
하하, 너 어디 맞아! 내가 정의하는 주위를 검색 할 때 나는이 발견 : 사실 WIN32 #DEFINE 부울 INT #DEFINE #ifdef와 1 #DEFINE 거짓 0 타입 정의 INT ssize_t; #define RET "\ r \ n"; #define mystring CString #endif 가끔 끔찍한 오래된 코드 작업 중! 그러나 거대한 감사! – Dan
#이 오류를 정의하면 다른 오류가 발생합니다. 작고 작은 프로젝트에 도움이 될 수 있습니다. 그러나 한 번 큰 것을 위해 아닙니다. 예를 들어 도움이되지 않습니다. 두 개의 프로젝트 중 하나는 컴파일되고 실행되기 때문에 다른 점이 있습니다. 다른 하나는이 오류를 제공합니다. – icaptan
icaptan,이 #define으로 원래 오류가 발생했습니다. Dan이 도움을 요청했습니다. Dan은 내가 옳았다 고 말했다. 그는 오류가 사라지도록 아마 그것을 삭제했습니다. 이제 icaptan 당신이 물어 #define 다른 오류가 발생하면 함께. 대답은 똑같지, 그렇지? 이 #define을 삭제하면 다른 오류도 사라질 것입니까? 그것은 오류가 무엇인지에 달려 있지만. 다른 오류에는 다른 수정이 필요합니다. –