So I use qmake to create my program, but I'm always having a conflict between my debug and release boost libraries with the message:
libboost_system-vc120-mt-s-1_58.lib(error_code.obj):-1: error: LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj
I would like to make this automated, in such a way where choosing debug or release from Qt Creator suffices to create the correct version. I saw other solutions like the one here, but that doesn't work. The reason why it doesn't work can be seen when calling the following command for both debug and release:
message($$CONFIG)
which will print the configuration of qmake. The results are the following:
For release:
lex yacc debug exceptions depend_includepath testcase_targets import_plugins import_qpa_plugin rtti_off incremental_off windows qt warn_on release link_prl incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe c++11 debug static rtti no_plugin_manifest qpa win32 msvc copy_dir_files release
For Debug:
lex yacc debug exceptions depend_includepath testcase_targets import_plugins import_qpa_plugin rtti_off incremental_off windows qt warn_on release link_prl incremental flat precompile_header autogen_precompile_source debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe c++11 debug static rtti no_plugin_manifest qpa win32 msvc copy_dir_files
Notice that both contain debug and release... and I'm wondering why...
I would like to point out that I compiled this Qt version from source. But there was no weird stuff when I did that. I used the following command to compile it (configure then compile with simple nmake):
configure -debug-and-release -opensource -platform win32-msvc2013 -opengl desktop -static -nomake examples -nomake tests
I tried a dull solution by adding the command: debug:CONFIG-=release
in my make file, but that will cause the release version to become debug with 30 MB size instead of 14 MB when I choose release from Qt Creator.
My qmake file is a typical one. The following is the part that could have anything to do with the problem. The other parts are just adding files and libraries and paths:
QMAKE_CFLAGS += /MT
QT += core gui
unix:QMAKE_CXXFLAGS += -std=c++11
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = MyProg
TEMPLATE = app
So why is this problem happening? Why are my debug or release a debug and release? How can I distinguish between them?
Please ask if you require any additional information.