2016-10-11 69 views
0

我編譯-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

回答

0
[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()未知