• Advertisement
Sign in to follow this  

redefinition different basic types

This topic is 4469 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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.

Share this post


Link to post
Share on other sites
oh...i didn't know that before but that solved my problem.
thx

regards,
m4gnus

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement