'Visual Studio 2010'에 해당되는 글 1건

  1. 2010.12.14 Conversion from VS2005 to VS2010
Troubleshooting2010. 12. 14. 12:24
발생했던 문제점들에 대한 해결 방법들을 공유합니다.

- boost
    - 1_44_0으로 갈아탐

- 변환시 vcproj 패스 설정 오류
    - Property Manager > Common Properties > User Macro의 경로중 하나가 잘못 컨버팅되서 재조정.
    - Ex) D:XXX/YYY/ZZZ/ZZZ 처럼... 2010으로의 자동 변환 후에 ZZZ가 두번 들어가 있었음.

- vs2010 error C2039: 'back_insert_iterator'
    - 인클루드 코드 삽입: #include <iterator>
    - PCH에 넣어도 되고, 에러가 난 파일의 헤더에 넣어도 되고~
   
- warning MSB8012: TargetPath does not match the Library's OutputFile property value
    - 이름을 맞춰줌
        - Property Page > Configuration Properties > General - Target Name과 Target Extension
        - Property Page > Configuration Properties > Librarian > General - Output File
    - http://blog.kalmbach-software.de/2010/04/27/converting-vc-projects-to-vc2010-warning-msb8012/
   
- Constructor for class 'Foo' is declared 'explicit'
    - 참조나 포인터가 아닌 객체로 함수의 인자가 되는 경우, 복사 생성이 암시적으로 발생하는데...
    - 복사생성자가 explicit으로 되어있을 경우, 2010에서는 error처리를 해준다. 땡큐!
    - 2010전에는 이것을 error로 처리 안 해줘서 그냥 넘어갔었고, 그래서 잘못된 것인지도 몰랐던거임. -_-;
   
- queue
    - queItems.c.clear()를 사용하고 있는 코드 발견 -_-;;;
    - Queue에 swap이 없긴 하지만, 저런식의 사용은 안 좋다고 본다.
    - 다른 방식으로 clear 할 수 있다
        - queItems.swap( queue<int>() ); 
        - std::swap( m_InfoQue, queue<int>() );

- warning MSB4011:
    "D:\XXX\XXX-Props\KUF2_PhysicalPath.props" cannot be imported again.
    It was already imported at
    "D:\XXX\XXX-Props\KUF2_Paths.props (4,5)".
    This is most likely a build authoring error. This subsequent import will be ignored.
    - Property Manger를 열어서 경고가 뜬 프로젝트의 Property Sheet 참조를 확인 해본다.
    - 이 경우는 임포트가 두 번 되어서 무시하겠다는 건데, 삭제 해주니 해결되었음.

- error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL’: value ‘0′ doesn’t match value ‘2′
    - http://stackoverflow.com/questions/4130044/what-does-iterator-debug-level-1-mean
         _ITERATOR_DEBUG_LEVEL = 0 (in release mode)
        _ITERATOR_DEBUG_LEVEL = 1 (in release mode if _SECURE_SCL is defined)
        _ITERATOR_DEBUG_LEVEL = 2 (in debug mode)        
    - http://blogs.msdn.com/b/vcblog/archive/2009/06/23/stl-performance.aspx
   
- #error _ITERATOR_DEBUG_LEVEL == 2 must imply _HAS_ITERATOR_DEBUGGING == 1 .
    - 코드가 아닌 곳에 디파인 되어 있을 수 있는데, 다음 2가지 경우가 있음.
      텍스트 검색으로 _HAS_ITERATOR_DEBUGGING을 찾아서 수동으로 변경.
        - 프로젝트 파일에 _HAS_ITERATOR_DEBUGGING이 0으로 디파인되어 있는 경우.
          Property Page > Configuration Properties > C/C++ > Preprocessor - Preprocessor Definitions
        - *.props 파일에 디파인되어 있을 수 있음.
        - Runtime Library가 일치하지 않는 프로젝트가 존재할 수 있음.
   
- XXX.lib(xxx.obj) : error LNK2019: unresolved external symbol
    - Menu > Project > Project Dependencies - 여기서 체크박스만 해주면 안되네;;
    - Menu > Project > Properties > Common Properties - Framework and References에서 Add New Reference... 눌러서 추가해 줘야함.
   
- 외부 라이브러리 2010으로 리빌드하면서 MSB8012 경고 잡아주기
    - yaml
    - loki
    - squirrel
    - sqplus

- libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
    - Ignore Specific Default Libraries에 libcmt.lib 추가
    - 지금까진 libcmt를 무시하라는 에러메세지가 뜬다고 해도 다른 방법으로 해결했었는데, 이번엔 잘 모르겠음;; 그냥 추가;;
    - Properties > Configuration Properties > Linker > Input - Ignore Specific Default Libraries
   
- warning C4717: 'SquirrelObject::Set<SquirrelObject>' : recursive on all control paths, function will cause runtime stack overflow   
    - 템플릿 매치 우선순위에 대한 문제였습니다.        
        - http://stackoverflow.com/questions/4427683/template-functions-priority-is-diferent-between-vs2005-and-vs2010
        - VS2005와 VS2010에서의 결과가 다릅니다.
        - Foo(const Foo&); ? Foo(Foo&) 로 변경해서 해결
    - 어쨌든 좀 혼란스러운 점이 있는데, 이를 C++ committee에서 곧 결정할 것이고, VS2010에서 이를 바로 반영한다고 합니다.

- :VCEnd" exited with code 1.
    - Exit code 1 indicates ~~~ path is not correct.
    - Post-Build Event에서 copy 명령이 있는데, 거기서 문제 발생.
    - 1이라는 말은 경로가 잘 못되어 있다는 말임. 경로 바꿔주고 해결.
    - 위에 기술된 warning MSB8012을 해결하기 위해서 경로들을 바꾸다 보니 발생했음.   

- LINK : fatal error C1047: The object or library file 'D:\XXX\YYY\ZZZ.lib' was created with an older compiler than other objects; rebuild old objects and libraries
    - ZZZ.lib 또는 ZZZ.lib가 쓰는 xxx.lib가 2010에서 빌드된 lib이 아니란 말.
    - 해당 라이브러리 빌드하면 해결됨.


[ 참조 ]

- Visual Studio 2010 C++ Project Upgrade Guide
    - http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx

- VS2010의 새로운 기능
    - 한: http://msdn.microsoft.com/ko-kr/library/dd465215.aspx
    - 영: http://msdn.microsoft.com/en-us/library/dd465215.aspx

- auto 사용
    - 추가 옵션 창에서 설정해 줘야함
    - Menu > Project > Properties > Configuration Properties > C/C++ > Command Line
        - Additional Options에서 다음을 입력 ( /Zc:auto )
    - ...하지만 설정 안 해줘도 됨 -_-; /Zc:auto- 하기 위해서는 설정해야할 것 같음.
    - http://msdn.microsoft.com/en-us/library/dd293615.aspx

- XP를 지원하기 위해 _WIN32_WINNT는 0X0501으로 정의
    - http://msdn.microsoft.com/en-us/library/aa383745(v=vs.85).aspx

- Tools > Options > Projects and Solutions > VC++ Project Settings - Build Timinig의 정보가 좀 더 자세하게 변경되었음
Posted by codevania