分享
 
 
 

DirectX SDK April 2005 在旧版本的VC6中可能造成编译问题

王朝vc·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

使用 DirectInput 的 IDirectInputDevice8::SetDataFormat 可能无法正常编译。

dinput8.lib(dilib2.obj) : fatal error LNK1103: debugging information corrupt; recompile module

去掉使用它的那句话就没有问题了。原因在于使用了新版的DIrextX SDK (April 2005 ).

解决方法:

备份 Dxerr9.lib 和 dinput8.lib 使用旧版的文件进行替换(比如 October 2004)。

网上找到的资料,原文:

You should have upgraded from VS6 to .Net 2003 by now. I am only doing this excercise because of some legacy apps that I have. Also, VS 2005 is currently at Beta 2 and some of you on the fence may just want to wait until it rolls before moving on from VS6 because it is pointless moving to .Net 2003 now (if you haven't already) with VS 2005 so close to release. So, don't take this post as an endorsement to not upgrade from VS6.

First things first. Don't even think of trying to use the latest June 2005 SDK. It won't work. Trust me on this.

Download the April 2005 DirectX SDK (scroll down the page to the "Older SDK Releases" section

Download the April 2005 MS Platform SDK (scroll down the page and download PSDK-x86.exe)

Go to Keith's site and download the April or June DirectX 9.0c D3DX Only Installer Download

Assuming that you are using the Summer or October 2004 DirectX SDK, go to the

Lib folder and copy the Dxerr9.lib and Dinput8.lib files to a temp folder.

Uninstall the current DirectX SDK.

Install the MS Platform SDK (assuming you don't already have the latest version installed)

Install the April 2005 DirectX SDK

Install the D3DX runtime files you downloaded from Keith's site

Reboot

Go to the Lib\x86\ folder where you installed the April 2005 SDK and backup the Dxerr9.lib and dinput8.lib files

Copy the Dxerr9.lib and dinput8.lib files from your previous Summer 2004 or October 2004 into the \Lib\x86 folder.

In the case of the Dxerr9.lib file, the reason for this is that MS compiled that library (don't ask me why they did this with only this file) with buffer overrun/security checking (as they do with all their .Net libs now,

hence the reason VS6 no longer works with DX) and any library function which makes calls to that library (e.g. to DXGetErrorString9) will cause linker errors

e.g.

Code:

Linking...

dxerr9.lib(dxerr9.obj) : error LNK2001: unresolved external symbol ___security_cookie

dxerr9.lib(dxerr9.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4

In the case of the dinput8.lib file, you will get this error when compiling a debug app. For some unGodly reason, this file seems to contain corrupt and/or incorrect debugging information. So you will see something like this if you don't use the older version. Incidentally, when comparing these legacy files, in April 2005 SDK, MS decided to include versions that are older than those in the October 2004 Update. Don't ask.

Code:

Linking...

dinput8.lib(dilib2.obj) : fatal error LNK1103: debugging information corrupt; recompile module

Error executing link.exe.

Start VS6 and go to Tools/Options/Directories. Make sure that the folder order is as indicated below. If any folder is not there, you need to add it. This is the order in which they need to appear.

Include files:

DirectX include folder

MS Platform SDK include folder

MS VC98 include folder

MS VC98 MFC include folder

MS VC98 ATL include folder

Library files:

DirectX lib folder

MS VC98 lib folder

MS VC98 MFC lib folder

Couple of things to note:

Keith states on his site that the April 2005 SDK works with VS6; which is why I decided to try it for this legacy app which I still had using the October 2004 SDK. I've sent him email letting him know that it doesn't quite work without the tinkering indicated above.

DirectShow is now in the MS Platform SDK. If you had modules which were based off any of its samples, you will have to modify them to work. e.g. this legacy app I was trying to build, was using an AVI player based on the original cutscene.cpp sample program included with DirectShow. Now that file has been moved into the \Microsoft Platform SDK\Samples\Multimedia\DirectShow\Players\Cutscene folder. It has been modified to work with later DX and MS PSDK builds, so your legacy app won't work without revision. e.g. you will get linker errors like lstrcpy_instead_use_StringCbCopy_or_StringCchCopy or wsprintf_instead_use_StringCbPrintf_or_StringCchPrintf etc because the older versions of some DirectShow samples, did stuff like:

Code:

wsprintf(szTitle, TEXT("%s: \0"), CUTSCENE_NAME);

_vsntprintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);

which have now been changed to:

Code:

(void)StringCchPrintf(szTitle, NUMELMS(szTitle), TEXT("%s: \0"), CUTSCENE_NAME);

(void)StringCchVPrintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);

You will have to revise your DirectShow sources to match the changes in the new samples in order to get them to work. Thats what I had to do with that one DirectShow sample (cutscene.cpp) that my player was based on.

If you have been compiling a DX8.1 based source app with the DX9 SDK, they will no longer compile without further tinkering. e.g. the d3dx8.h file is gone. And no, replacing all calls to that header file with d3dx9.h won't work without further significant tinkering. You will have to port the app to DirectX9 SDK. Good luck with that if you didn't do it before. If someone knows a way around this and which I may not be aware of, please let me know.

If you have been compiling a DX8.1 based source app with the DX9 SDK, they will no longer compile without further tinkering. e.g. the d3dx8.h file is gone. And no, replacing all calls to that header file with d3dx9.h won't work without further significant tinkering. You will have to port the app to DirectX9 SDK. Good luck with that if you didn't do it before. If someone knows a way around this and which I may not be aware of, please let me know.

Start VS6 and go to Tools/Options/Directories. Make sure that the folder order is as indicated below. If any folder is not there, you need to add it. This is the order in which they need to appear.

Include files:

DirectX include folder

MS Platform SDK include folder

MS VC98 include folder

MS VC98 MFC include folder

MS VC98 ATL include folder

Library files:

DirectX lib folder

MS VC98 lib folder

MS VC98 MFC lib folder

Couple of things to note:

Keith states on his site that the April 2005 SDK works with VS6; which is why I decided to try it for this legacy app which I still had using the October 2004 SDK. I've sent him email letting him know that it doesn't quite work without the tinkering indicated above.

DirectShow is now in the MS Platform SDK. If you had modules which were based off any of its samples, you will have to modify them to work. e.g. this legacy app I was trying to build, was using an AVI player based on the original cutscene.cpp sample program included with DirectShow. Now that file has been moved into the \Microsoft Platform SDK\Samples\Multimedia\DirectShow\Players\Cutscene folder. It has been modified to work with later DX and MS PSDK builds, so your legacy app won't work without revision. e.g. you will get linker errors like lstrcpy_instead_use_StringCbCopy_or_StringCchCopy or wsprintf_instead_use_StringCbPrintf_or_StringCchPrintf etc because the older versions of some DirectShow samples, did stuff like:

Code:

wsprintf(szTitle, TEXT("%s: \0"), CUTSCENE_NAME);

_vsntprintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);

which have now been changed to:

Code:

(void)StringCchPrintf(szTitle, NUMELMS(szTitle), TEXT("%s: \0"), CUTSCENE_NAME);

(void)StringCchVPrintf(szBuffer, NUMCHARS - 1, szFormat, pArgs);

You will have to revise your DirectShow sources to match the changes in the new samples in order to get them to work. Thats what I had to do with that one DirectShow sample (cutscene.cpp) that my player was based on.

If you have been compiling a DX8.1 based source app with the DX9 SDK, they will no longer compile without further tinkering. e.g. the d3dx8.h file is gone. And no, replacing all calls to that header file with d3dx9.h won't work without further significant tinkering. You will have to port the app to DirectX9 SDK. Good luck with that if you didn't do it before. If someone knows a way around this and which I may not be aware of, please let me know.

If you have been compiling a DX8.1 based source app with the DX9 SDK, they will no longer compile without further tinkering. e.g. the d3dx8.h file is gone. And no, replacing all calls to that header file with d3dx9.h won't work without further significant tinkering. You will have to port the app to DirectX9 SDK. Good luck with that if you didn't do it before. If someone knows a way around this and which I may not be aware of, please let me know.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有