2009-02-03 4 views
0

이전 프로젝트를 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 

답변

-1

가 자신의 코드가 같은 것을 할 않습니다 감사합니다 나는 첫 번째쪽으로 기울고있다. msdn을 확인하고 comutil.h가 포함될 수있는 시간에 대한 제한이 없는지 확인하고 싶을 수도 있습니다 (windows.h 이전에 winsock2.h를 포함하면이 문제가 있다는 것을 알고 있습니다). C/C++> 고급 포함 (명령 줄에서/showIncludes 옵션) 옵션도 있습니다. 일반적으로이 문제를 추적 할 때 유용합니다.

+0

하하, 너 어디 맞아! 내가 정의하는 주위를 검색 할 때 나는이 발견 : 사실 WIN32 #DEFINE 부울 INT #DEFINE #ifdef와 1 #DEFINE 거짓 0 타입 정의 INT ssize_t; #define RET "\ r \ n"; #define mystring CString #endif 가끔 끔찍한 오래된 코드 작업 중! 그러나 거대한 감사! – Dan

+0

#이 오류를 정의하면 다른 오류가 발생합니다. 작고 작은 프로젝트에 도움이 될 수 있습니다. 그러나 한 번 큰 것을 위해 아닙니다. 예를 들어 도움이되지 않습니다. 두 개의 프로젝트 중 하나는 컴파일되고 실행되기 때문에 다른 점이 있습니다. 다른 하나는이 오류를 제공합니다. – icaptan

+0

icaptan,이 #define으로 원래 오류가 발생했습니다. Dan이 도움을 요청했습니다. Dan은 내가 옳았다 고 말했다. 그는 오류가 사라지도록 아마 그것을 삭제했습니다. 이제 icaptan 당신이 물어 #define 다른 오류가 발생하면 함께. 대답은 똑같지, 그렇지? 이 #define을 삭제하면 다른 오류도 사라질 것입니까? 그것은 오류가 무엇인지에 달려 있지만. 다른 오류에는 다른 수정이 필요합니다. –

0

이 주문 문제를 포함하거나 당신이 뭔가를 언급으로 정의 가져 오지하지만, 두 가지 중 하나를 다음과 같습니다 올바른 방향으로 모든 포인터는 많이