본문 바로가기
QT and Symbian

QT release compile error (LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL': value ‘2’ doesn’t match value ‘0’)

by leo21c 2015. 7. 3.
SMALL

QT release compile을 할 때 아래와 같은 에러가 발생했다.

error LNK2038: mismatch detected for ‘_ITERATOR_DEBUG_LEVEL': value ‘2’ doesn’t match value ‘0’


검색 결과 debug로 컴파일 되어 만들어진 *.lib 파일을 이용해서 release로 컴파일 할 경우에 발생한다고 한다.
https://technet.microsoft.com/ko-kr/subscriptions/hh697468.aspx

Source와 Project - Property Pages에서 확인을 해서 사용하고 있는 lib를 직접 editer로 읽어 보고 _ITERATOR_DEBUG_LEVEL이 존재하는지도 확인을 해 보았다.

확인 결과 Qt에서 제공하는 *.lib 파일이 두 종류라는 것을 확인했다.

예를 들어, qtmain.lib 파일과 qtmaind.lib 두개의 lib 파일이 존재하고 뒤에 d가 붙어 있는 것은 debug용으로 사용하는 lib 파일이고 d가 없는 것은 release용 파일이다.

따라서 Property - Linker - Additional Dependencies에 등록된 lib 파일의 이름을 확인해서 debug 모드 때에는 d가 붙은 파일을 사용하고 release일 때에는 d를 지워주고 compile을 하면 linker 에러가 발생하지 않고 정상적으로 compile이 된다.

LIST