Qt 用 nmake compile 出錯

要在 Visual Studio 中 compile Qt 程式,利用 namke 將 Qt source code recompile 是必要的步驟(當然像 Qt 4.6.3 就有原生 for VS2008 的是例外)。但有時候我們 compile 會出錯,除了將出錯且沒用到的 module disable 之外,我們還可以注意 Windows SDK 的版本。


比如說我電腦有安裝 Windows SDK 6.0 及 7.0 兩版,而我 VS 2008 中 Tool->Options->Projects and Solutions->VC++ Directories 中,手動加入了 Windows SDK 6.0 的連結。當我 compile Qt 時就會出錯。此時如果將此手動項目移除,由於 VS 2008 裡頭就有增加對 Windows SDK 的 include 了($(WindowsSdkDir)\include),當我將 Windows SDK 6.0 include path 移掉之後,compile Qt 就成功了。


以上供參考。


留言

熱門文章