今天在VS2015中用編譯好的QT5靜態庫打包軟件,配置好QT的靜態環境后,
發現報MSVCRTD.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
錯誤,顯然__except_handler4 是定義在VC運行時庫的函數,顯然這個函數被自動linked了,肯定是某個地方使用了動態鏈接到運行時庫的
lib了,排查排查,果然,只有一個模塊zlib.lib,我用了里面的crc校驗和文件操作的函數,但是使用的函數並沒報錯,可能是提前的error已經出現,
后面的errror還沒有鏈接到,所有函數沒報鏈接錯誤,MSVCRTD.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4錯誤,所以我先去掉了這個zlib.lib,果然,程序編譯成功。