1. 程式人生 > >LINK : fatal error LNK1104: 無法開啟檔案“qtmaind.lib”

LINK : fatal error LNK1104: 無法開啟檔案“qtmaind.lib”

在網上找了好久,沒看到有效的方法,我綜合網上的帖子得出下面的方法。

方法:

1.進入開始選單Microsoft Visual Studio 2010,Visual Studio Tools,Visual Studio Command Prompt (2010),需要注意的是,這裡面必須是使用Visual Studio Command Prompt (2010),不能使用CMD的Dos視窗

2.進入Qt的安裝根目錄


3.執行命令 configure -platform win32-msvc2010,o(選擇opensource模式)回車,Y(同意license)回車

注:在編譯過程中,為了加快速度,可以對configure適當的加些引數,比如-fast,-no-webkit(這個貌似挺耗時的)

我選擇的命令列:configure -platform win32-msvc2010 -fast -debug-and-release -no-webkit -no-script -no-qt3support -nomake demos -nomake examples -nomake

如果需要openssl的支援,需要加入-openssl-linked  選項

4.接著就會自動配置Qt的編譯環境,等配置結束後,執行nmake,回車。


5.在這之後可以使用nmake clean進行清理掉那些中間檔案(pdb,obj等檔案),清理出4個G左右的空間。


nmake confclean是清理配製檔案,佔的空間不大,可以不執行了。

6.關掉Vistual Studio x64 Win64命令提示(2010)框,再次在VS2010下除錯,就不會出現這個錯誤了。

在老大的幫助下,發現是自己裝錯了檔案,應該裝