巨大的巧合,因爲我在一個小時前有完全相同的問題,並找到了一個非常簡單的解決方案。如果您使用#pragma註釋指令包含您的DirectX庫,你只需要爲他們提供您的庫(而不是僅僅名稱)的這樣的完整路徑:
#pragma comment (lib, "c:/Softwares/Development/Lib/DirectX/Lib/x86/dxgi.lib")
#pragma comment (lib, "c:/Softwares/Development/Lib/DirectX/Lib/x86/d3d11.lib")
#pragma comment (lib, "c:/Softwares/Development/Lib/DirectX/Lib/x86/d3dx11.lib")
#pragma comment (lib, "c:/Softwares/Development/Lib/DirectX/Lib/x86/d3dx10.lib")
顯然,在我的路徑示例與我的個人配置有關,您應該在您的計算機上定義DirectX libs目錄的正確路徑。然後,您只需轉到您的項目配置 - > C/C++ - > General - > Additionnal Include Directories並設置DirectX包含文件的路徑。
就是這樣!現在您可以編譯您的DirectX界面並將其鏈接到另一個項目,而無需進行更多的設置。
我希望它能幫助你,並對我的壞英語感到抱歉。 :)
來源
2012-10-11 00:44:40
RT2