5 Replies - 684 Views - Last Post: 12 November 2009 - 02:12 AM Rate Topic: -----

#1 ArcticFox  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 83
  • Joined: 05-April 09

undeclared identifier

Posted 11 November 2009 - 12:34 PM

c:\documents and settings\arcticfox\desktop\ncrp dp\header.h(27) : error C2065: 'n_AddPlayerClass' : undeclared identifier
c:\documents and settings\arcticfox\desktop\ncrp dp\header.h(28) : error C2065: 'n_SendClientMessage' : undeclared identifier

I get the errors from
AMX_NATIVE_INFO NCRPNat[ ] =
{
	{ "AddPlayerClass",			n_AddPlayerClass },
	{ "SendClientMessage",		n_SendClientMessage },
	{ 0,					0 }
};
can't explain more I'm new to C++ and also if someone could explain me how to fix that

Is This A Good Question/Topic? 0
  • +

Replies To: undeclared identifier

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6066
  • View blog
  • Posts: 23,526
  • Joined: 23-August 08

Re: undeclared identifier

Posted 11 November 2009 - 12:40 PM

At the point where you're using those identifiers, they're not yet defined. We'll need to see/know more context to be helpful.
Was This Post Helpful? 0
  • +
  • -

#3 ArcticFox  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 83
  • Joined: 05-April 09

Re: undeclared identifier

Posted 11 November 2009 - 01:19 PM

View PostJackOfAllTrades, on 11 Nov, 2009 - 11:40 AM, said:

At the point where you're using those identifiers, they're not yet defined. We'll need to see/know more context to be helpful.

can you explain a bit more
Was This Post Helpful? 0
  • +
  • -

#4 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: undeclared identifier

Posted 11 November 2009 - 03:06 PM

What do you need explained more? That's an English sentence, and it seems like you understand the English part. It's a good guess you don't get the technical information, so do you mind telling us what you didn't understand exactly?
Was This Post Helpful? 0
  • +
  • -

#5 gronk  Icon User is offline

  • D.I.C Head

Reputation: 13
  • View blog
  • Posts: 168
  • Joined: 28-October 09

Re: undeclared identifier

Posted 11 November 2009 - 03:41 PM

Before the compiler can determine how to construct an NCRPNat it needs to know what n_AddPlayerClass.
It doesn't, so it throws the error.

We can't tell you much more about how to fix it, other than by saying that you need to define n_AddPlayerClass. But you probably guessed that.

As you're new to C++ my guess is that this is someone else's code that you're trying to compile. Just the small snippet you've shown suggests this is not beginner code. You'll need to discuss this problem with whoever wrote the code. There is no single definition of n_AddPlayerClass that all expert programmers implicitly know.
Was This Post Helpful? 0
  • +
  • -

#6 ArcticFox  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 83
  • Joined: 05-April 09

Re: undeclared identifier

Posted 12 November 2009 - 02:12 AM

fixed it thanks for the help
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1