使用QT与DLL与-MT崩溃编译

问题描述:

我编译-MT QT动态(修改配置文件)使用QT与DLL与-MT崩溃编译

我的代码是这样的(我的计划是与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] 

任何人会帮我吗?

+0

图像未添加 – pableiros

[enter image description here][1] 

[email protected]()未知 [email protected]()未知

qwindows.dll!_free_base(无效*块= 0x00425dc0)112线C++ qwindows.dll!free(void * block = 0x00425dc0)Line 30 C++ qwindows.dll!operator delete(void * block = 0x00425dc0,unsigned int formal = 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!Q对象::〜QObject()行1049 C++ Qt5Core.dll!QFactoryLoader ::〜QFactoryLoader()行209 C++ Qt5Gui.dll!```匿名命名空间':: Q_QGS_loader :: innerFunction':: 2'::动态atexit析构函数为'保持器 ''()C++ Qt5Gui.dll _execute_onexit_table :: __ L2:!:()206线C++ Qt5Gui.dll __ crt_seh_guarded_call ::运算符()<,INT(无效)&,>(__ acrt_lock_and_call :: __ L2 :: & & 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_o nexit_table :: __ L2 :: INT(无效)& &行动= INT(无效){...})912线C++ Qt5Gui.dll _execute_onexit_table(_onexit_table_t *表= 0x0f873798)线160 C++ Qt5Gui.dll common_exit!: :__ L2::()215线C++ Qt5Gui.dll __ crt_seh_guarded_call ::运算符()<,孔隙(空隙)&,>(__ acrt_lock_and_call :: __ L2 :: & &设置= {...},common_exit :: __ L2! :: void(void)& action = void(void){...},__acrt_lock_and_call :: __ l2 :: & & cleanup = {...})Line 225 C++ Qt5Gui.dll!__ acrt_lock_and_call(void)>(const __acrt_lock_id lock_id = __ acrt_exit_lock,common_exit :: __ l2 :: void(void)& &行动=空隙(空隙){...})线912 C++ Qt5Gui.dll!common_exit(const int的值return_code = 0,常数_crt_exit_cleanup_mode cleanup_mode = _crt_exit_full_cleanup,常量_crt_exit_return_mode return_mode = _crt_exit_return_to_caller)263线C++ Qt5Gui.dll!_cexit ()线298 C++ Qt5Gui.dll!dllmain_crt_process_detach(常量布尔is_terminating =真)线109 C++ Qt5Gui.dll!dllmain_crt_dispatch(HINSTANCE * const的实例= 0x0f4f0000,常量无符号长原因= 0,无效* const的保留= 00000001)行134 C++ Qt5Gui.dll!dllmain_dispatch(HINSTANCE__ * const instance = 0x0f4f0000,const unsigned long reason = 0,void * const reserved = 0x00000001)Line 207 C++ Qt5Gui.dll!_DllMainCRTStartup(HINSTANCE__ * const instance = 0x0f4f0000,const unsigned long reason = 0,void * const保留= 0x00000001)行248 C++ ntdll.dll!_LdrpCallInitRoutine @ 16()未知 [email protected]()未知 [email protected]()未知 [email protected]()未知 qt_template.exe!exit_or_terminate_process(const的无符号整型值return_code )线129 C++ qt_template.exe!common_exit(const int的值return_code = 0,常数_crt_exit_cleanup_mode cleanup_mode = _crt_exit_full_cleanup,常量_crt_exit_return_mode return_mode = _crt_exit_terminate_process)218线C++ qt_template.exe!出口(INT值return_code = 0)线282 C++ qt_template。 EXE!__ scrt_common_main_seh()Line 262 C++ kernel32.dll!@ BaseThreadInitThunk @ 12()Unknown ntdll.dll!___ RtlUserThreadStart @ 8()Unknown ntdll.dll!__ RtlUserThrea dStart @ 8()未知