redefinition different basic types

Started by
1 comment, last by m4gnus 18 years, 4 months ago
Hi I haven't been programming for a while now(my graphiccard just crashed :( ) and now i extended my vertex-class but atm i'm not even able to add an empty function to that class. I think it's something very simple(because of the lack of training recently) but i just can't find the error. ngVertex.h:(i deleted all outcommented parts)

#pragma once
#include <windows.h>
#include "ngVector3.h"
#include "ngVector2.h"
#include "ngUnknown.h"
#include <vector>
class ngVertex : public ngUnknown
{
private:
	void* vertexptr;
	DWORD fvf;
public:
	void create(DWORD fvf);
	void release();
	ngVertex(void);
	~ngVertex(void);
};

ngVertex.cpp


#include ".\ngvertex.h"
#include <d3dx9.h>

ngVertex::ngVertex(void)
{
	
}

ngVertex::~ngVertex(void)
{
}

void ngVertex::create(DWORD fvf)
{
	
}

void ngVertex::release()
{
}

and the part where i use the class:

#include "ngVertex.h"

ngVertex vertEx;

vertEx.create(DWORD(D3DFVF_XYZ));

and the errors: f:\Programmiertes\nGin\nGin.cpp(24): error C2143: syntax error : missing ';' before '.' f:\Programmiertes\nGin\nGin.cpp(24): error C2371: 'vertEx' : redefinition; different basic types f:\Programmiertes\nGin\nGin.cpp(24): error C2501: 'vertEx' : missing storage-class or type specifiers regards, m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."
Advertisement
You can't call member functions on objects in namespace scope. If you want to call vertEx.create() you need to do it inside of a function.
oh...i didn't know that before but that solved my problem.
thx

regards,
m4gnus
"There are 10 types of people in the world... those who understand binary and those who don't."

This topic is closed to new replies.

Advertisement