fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64

xxxxxx.lib(xxxxxx.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'



1. 先看看你的模塊是否是64位,這個一般都是,如何配置64位工程,這裏就不說了;


2. 查看該模塊鏈接的靜態庫或者dll是否是64位的

Configuration-->kinker-->General-->Additional Library Directories 看看是鏈接到64位的目錄;

Configuration-->kinker-->input-->Additional Dependencies  中的庫是否都是64位;


3. 看看你鏈接的庫是否都按64位編譯的,臨時文件,目標文件是否生成到64位目錄;


4. 看看你鏈接的靜態庫:

Configuration-->Librarian-->General-->Additional Dependencies

Configuration-->Librarian-->General-->Additional library Directories

是否有依賴32位內容,其實靜態庫不需要鏈接靜態庫,我就是因爲靜態庫去依賴了32位的,導致64位模塊編譯失敗。


5. 最後實在不行試試改這個地方

Configuration-->Preprocessor-->Preprocessor Definitions-->WIN32改爲_WIN64


總結:

xxxxxx.lib(xxxxxx.obj) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

這個錯誤提示想告訴你的是,該64位模塊依賴了32位的東西,確保你依賴的庫都是32位,並且依賴的庫沒有包含別人32位的東西。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章