Использовать QT с DLL, скомпилированной с ошибкой -MT
Я скомпилировал QT динамически с -MT(изменить файл конфигурации)
мой код такой (моя программа тоже в режиме релиза с МТ):
int main( int argc, char *argv[] )
{
int ret = 0;
if( 0 == ret )
{
QApplication a( argc, argv );
{
test01 w;
w.show();
ret = a.exec();
}
}
return ret;
}
test01 is very simple like this:
class test01 : public QMainWindow
{
Q_OBJECT
public:
test01(QWidget *parent = 0);
~test01();
private:
Ui::test01Class ui;
};
все в порядке, но при выходе из основной функции происходит сбой:
[enter image description here][1]
Кто-нибудь мне поможет?
1 ответ
[enter image description here][1]
ntdll.dll!_RtlFreeHeap@12() Неизвестно kernel32.dll!_HeapFree@12() Неизвестно
qwindows.dll!_free_base(void * block=0x00425dc0) Строка 112 C++ qwindows.dll!free(void * block=0x00425dc0) Строка 30 C++ qwindows.dll! оператор delete(void * block=0x00425dc0, неподписанный int формальный =8) Строка 15 C++ qwindows.dll!QWindowsIntegrationPlugin::
scalar deleting destructor'(unsigned int) C++ Qt5Core.dll!QLibraryPrivate::unload(QLibraryPrivate::UnloadFlag flag=UnloadSys) Line 558 C++ Qt5Core.dll!QFactoryLoaderPrivate::~QFactoryLoaderPrivate() Line 87 C++ Qt5Core.dll!QFactoryLoaderPrivate::
скалярное удаление деструктора '(unsigned int) C++ Qt5Core.dll!QObject::~QObject() Строка 1049 C++ Qt5Core.dll!QFactoryLoader::~QFactoryLoader() Строка 209 C++ Qt5Gui.dll!`` Анонимное пространство имен'::Q_QGS_loader::innerFunction'::2'::
деструктор динамического атрибута для 'holder''() C++ Qt5Gui.dll!_execute_onexit_table::__l2::() Строка 206 C++ Qt5Gui.dll! __ crt_seh_guarded_call:: operator () <, int (void) &,> (__ acrt_lock_and_call:: all:: && setup={...}, _execute_onexit_table::__l2::int (void) & action=int (void){...}, __acrt_lock_and_call::__l2:: && cleanup={...}) Строка 204 C++ Qt5Gui.dll!__acrt_lock_and_call(void) >(const __acrt_lock_id lock_id=__acrt_exit_lock, _execute_onexit_table::__l2::int (void) && action=int (void){...}) строка 912_exute ({)} **5 _onexit_table_t * table=0x0f873798) Строка 160 C++ Qt5Gui.dll!common_exit::__l2::() Строка 215 C++ Qt5Gui.dll! __ crt_seh_guarded_call:: operator () <, void (void) &,> (__ acrt_lock_and_call) && setup={...}, common_exit::__l2::void (void) & action=void (void){...}, __acrt_lock_and_call::__l2:: && cleanup={...}) Строка 225 C++ Qt5Gui.dll!__acrt_lock_and_call(void) >(const __acrt_lock_id lock_id=__acrt_exit_lock, common_exit::__l2::void (void) && action=void (void){...}) Линия 912 C++ Qt5Gui.dll! Common_exit (Const INT код_возврата =0, Const _crt_exit_cleanup_mode cleanup_mode=_crt_exit_full_cleanup, Const _crt_exit_return_mode return_mode = _crt_exit_return_to_caller) Линия 263 C++ Qt5Gui.dll!_Cexit () Строка 298 C++ Qt5Gui.dll! Dllmain_crt_process_detach(Const BOOLis_terminating = истина) линия 109 C++ Qt5Gui.dll! dllmain_crt_dispatch (HINSTANCE * Const экземпляр =0x0f4f0000, сопзЬ неподписанных долго причина =0, аннулируются * Const зарезервирован =0x00000001) Line 134 C++ Qt5Gui.dll!dllmain_dispatch(HINSTANCE__ * Const экземпляр =0x0f4f0000, const беззнаковая длинная причина =0, void * const зарезервировано = 0x00000001) Строка 207 C++ Qt5Gui.dll!_DllMainCRTStartup(HINSTANCE__ * const instance=0x0f4f0000, const беззнаковая длинная причина =0, void * const зарезервирована = 0x00000001) Строка 248 C++.dll!_LdrpCallInitRoutine@16() Неизвестно ntdll.dll!_LdrShutdownProcess@0() Неизвестно ntdll.dll!_RtlExitUserProcess@4() Неизвестно kernel32.dll!_ExitProcessStub@4() Неизвестно qt_template.exe!exit_or_cessstigned код_возврата) Линия 129 C++ qt_template.exe!common_exit(Const INT код_возврата =0, Const _crt_exit_cleanup_mode cleanup_mode=_crt_exit_full_cleanup, Const _crt_exit_return_mode return_mode=_crt_exit_terminate_process) Линия 218 С ++ qt_template.exe! Выход (интермедиат код_возврата = 0) Строка 282 C++ qt_template.exe!__scrt_common_main_seh() Строка 262 C++ kernel32.dll!@BaseThreadInitThunk@12() Неизвестно ntdll.dll!___RtlUserThreadStart@8() Неизвестно ntdll.dll!__RtlUserThreadStart@8() Неизвестно