I'm getting hundreds of errors (251 to be precise) in the file xnamath.h. I'm not going to show them all, because that wouldn't make sense. The file is fine, and I can use it perfectly in other projects. It's hard to find the cause of a problem if visual studio shows errors which are not wrong. I got this problem when creating the following class (pretty simple, so I don't see how this would cause any problems). Thanks in advance. (btw, I'm pretty sure this belongs to general programming. If not, sorry about that
ModelInstance.cpp:
[source lang="cpp"]#include "ModelInstance.h"ModelInstance::ModelInstance(XMFLOAT3 scale, XMFLOAT3 rot, XMFLOAT3 offset) :Scale(scale), Rot(rot), Offset(offset), Scale2(XMFLOAT3(1.0f, 1.0f, 1.0f)), Rot2(XMFLOAT3(0, 0, 0)), Offset2(XMFLOAT3(0, 0, 0)){}ModelInstance::~ModelInstance(){}void Modelinstance::Update(float dt, bool walk, XMFLOAT3 scale, XMFLOAT3 rot, XMFLOAT3 offset){ Scale2 = scale; Rot2 = rot; Offset2 = offset;}XMFLOAT4X4 Modelinstance::World(){ XMFLOAT4X4 worldTransform; XMStoreFloat4x4(&worldTransform, XMMatrixScaling(Scale.x, Scale.y, Scale.z) * (XMMatrixRotationX(Rot.x) * XMMatrixRotationY(Rot.y) * XMMatrixRotationZ(Rot.z)) * XMMatrixTranslation(Offset.x, Offset.y, Offset.z) * XMMatrixScaling(Scale2.x, Scale2.y, Scale2.z) * (XMMatrixRotationX(Rot2.x) * XMMatrixRotationY(Rot2.y) * XMMatrixRotationZ(Rot2.z)) * XMMatrixTranslation(Offset2.x, Offset2.y, Offset2.z)); return worldTransform;}[/source]
ModelInstance.h:
[source lang="cpp"]#ifndef MODELINSTANCE_H#define MODELINSTANCE_H#include <xnamath.h>struct ModelInstance{public: ModelInstance(XMFLOAT3 scale, XMFLOAT3 rot, XMFLOAT3 offset); virtual ~ModelInstance(); virtual void Update(float dt, bool walk, XMFLOAT3 scale, XMFLOAT3 rot, XMFLOAT3 offset); XMFLOAT4X4 World();protected: XMFLOAT3 Scale, Scale2; XMFLOAT3 Rot, Rot2; XMFLOAT3 Offset, Offset2;};#endif[/source]







