智能感知:标识符"XMFLOAT4"未定义
IntelliSense: Identifier "XMFLOAT4" is undefined
#ifndef RENDERER_H
#define RENDERER_H
#pragma once
#include "Font.h"
#include "Color.h"
#undef CreateFont
struct Vertex_t {
XMFLOAT4 xyzrhw;
D3DCOLOR color;
enum {
FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE
};
};
当我尝试编译时出现此错误:
智能感知:标识符"XMFLOAT4"未定义。
我该如何解决这个问题?
从您的代码中不清楚您包含<DirectXMath.h>
的位置,所以我假设它在 Font.h 或 Color.h 中的某个地方。
DirectXMath 使用 C++ 命名空间DirectX
因此应使用:
struct Vertex_t {
DirectX::XMFLOAT4 xyzrhw;
D3DCOLOR color;
enum {
FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE
};
};
C++编码建议是避免将using namespace
语句放在标头中,而仅将它们保留在.cpp文件的本地。
相关文章:
- 编译C++时未定义的引用
- vscode g++链路故障:体系结构x86_64的未定义符号
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 不知道某个东西是否被忽略会引入未定义的行为吗
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- 未定义的引用在哪里
- 编译时的 CImg 库返回对"__imp_SetDIBitsToDevice"的未定义引用
- 对Py_Initialize()的未定义引用
- c++11评估顺序(未定义的行为)
- 使用mysql c++连接器的未定义引用
- 从python调用openMP共享库时,未定义opnMP函数
- 在 Mac 上使用 CMAKE 将 FFTW 和 FFTWPP 链接到项目中时未定义的符号
- Cmake 链接问题:未定义对 Button::mousePressEvent(QGraphicsSceneMouseE
- 未定义的引用 .. 使用 OpenCV 编译 C++ 代码时,从命令行
- 具有外部"c"和程序集的未定义函数
- 此增量后语句是否会导致未定义的行为?
- 尝试调用 .h 文件中定义的变量时出现变量未定义错误
- 在C++中使用内联方法时出现未定义的符号错误
- 智能感知:标识符"XMFLOAT4"未定义