相关疑难解决方法(0)

822
推荐指数
10
解决办法
35万
查看次数

头部防护/翻译单元问题

我的印象是标题守卫解决了重新定义的问题.我收到链接器错误,说明.obj文件中有重新定义.这是我所包含的标题,问题在于重新定义所有全局声明.

#ifndef DIRECT3D_H
#define DIRECT3D_H

// global declarations
ID3D10Device* device;
ID3D10Buffer* pBuffer;
ID3D10Buffer* iBuffer;    // the pointer to the index buffer
ID3D10RenderTargetView* rtv;    // the pointer to the render target view
ID3D10DepthStencilView* dsv;    // the pointer to the depth stencil view
IDXGISwapChain* swapchain;    // the pointer to the swap chain class
ID3D10Effect* pEffect;
ID3D10EffectTechnique* pTechnique;
ID3D10EffectPass* pPass;
ID3D10InputLayout* pVertexLayout;
ID3D10EffectMatrixVariable* pTransform;    // the pointer to the effect variable interface
D3D10_PASS_DESC PassDesc;

// function prototypes
void initD3D(HWND hWnd);
void render_frame();
void …
Run Code Online (Sandbox Code Playgroud)

c++

1
推荐指数
1
解决办法
219
查看次数

标签 统计

c ×1

c++ ×1

c++-faq ×1

declaration ×1

definition ×1

terminology ×1