Sign in to follow this  
m4gnus

redefinition different basic types

Recommended Posts

m4gnus    240
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

Share this post


Link to post
Share on other sites
SiCrane    11839
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this