error LNK2019: 无法解析的外部符号 _Direct3DCreate9@4,该符号在函数 "int __cdecl InitD3D(struct HWND__ *,unsigned lo

来源:互联网 发布:测评软件 编辑:程序博客网 时间:2024/06/05 07:45

错误 1 error LNK2019: 无法解析的外部符号 _Direct3DCreate9@4,该符号在函数 "void __cdecl InitD3D(struct HWND__ *)" (?InitD3D@@YAXPAUHWND__@@@Z) 中被引用

解决方法:

在VS.NET中的项目/属性/配置属性/连接器/输入/附加依赖项中添加以下文件名,d3dx9.lib d3dxof.lib d3d9.lib winmm.lib dxguid.lib comctl32.lib 就可以了.


    这个问题还有另外一种解决方法,就是在程序的开头写 
    #pragma comment(lib,"d3d9.lib") 
    #pragma comment(lib,"winmm.lib") 
    #pragma comment(lib,"d3dx9.lib")

我自己的情况:

    只在依赖库中加入d3d9.lib就OK了


1 0