2012-07-12 144 views
4

我剛剛轉移到Visual Studio 2012 RC以使其進行測試運行。但是我在使DirectX 11遊戲項目與它一起工作時遇到了問題。當我建立我得到1152個警告,所有看起來像這樣:發佈移動項目到Visual Studio 2012

1>e:\program files (x86)\microsoft directx sdk (june 2010)\include\dwrite.h(4972): warning C4005: 'DWRITE_E_NOFONT' : macro redefinition 
1>   c:\program files (x86)\windows kits\8.0\include\shared\winerror.h(50217) : see previous definition of 'DWRITE_E_NOFONT' 

他們來自所有的DirectX頭,每一個是不同的宏。我也得到我沒拿到之前的一些未解決的外部符號:

1>base.obj : error LNK2019: unresolved external symbol "void __cdecl operator delete(void *,int,char const *,int)" ([email protected]@Z) referenced in function [email protected]@YAXXZ$0 
1>game.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,int,char const *,int)" ([email protected]@Z) 
1>world.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *,int,char const *,int)" ([email protected]@Z) 

我想delete將超載的唯一地方是在#include <crtdbg.h>,我用我的項目。但事情是,所有這些工作在Visual Studio 2010中。

不確定是什麼問題。轉換項目時是否缺少任何步驟?

我還應該提到我的電腦以前崩潰了(我只丟失了Windows和註冊表),所以我不得不重新安裝我的大部分程序。我不知道這是否會起作用,但自從崩潰以來,我還沒有在VS2010上編譯這個項目。

+0

看起來這是VS2012附帶的新C運行時庫的問題。用不同的舊庫編譯的項目在這裏和那裏存在很多類似的問題。 – 2012-07-12 19:37:27

+0

正在嘗試爲x64構建? – 2012-07-12 19:42:19

+0

@SergeyK。不,我應該嘗試嗎? – smoth190 2012-07-12 23:58:36

回答

3

您需要使用VS2012重新編譯所有庫以解決此問題。這是VS2012附帶的新C運行時庫的問題。

+0

我需要Windows 8 DirectX SDK嗎?因爲我不想使用它。如果我不能使用2012年6月的SDK,我會堅持使用VS2010 for DirectX ... – smoth190 2012-07-12 23:59:29

+0

它肯定會出現這種情況。 VS2012是一個候選版本,所以使用它進行生產是相當危險的。 – 2012-07-13 06:39:32

+0

那真是令人失望。我想我只能堅持使用VS2010來進行遊戲開發。 – smoth190 2012-07-13 17:47:31