Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Link error!

This topic is 6118 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

I get this: "player.obj : error LNK2001: unresolved external symbol "class CEntity * * bPlayerList" (?bPlayerList@@3PAPAVCEntity@@A)" For: "bPlayerList[NumberofPlayers] = bPlayer;" bPlayerList is: "CEntity *bPlayerList[];" How to fix this? it works without the array?(CEntity *bPlayerList

Share this post

Link to post
Share on other sites
Well not quite sure what the hell you wrote there

but I''ll stab at it:

first CEntity *bPlayerList[]; needs to be something like this:
CEntity *bPlayerList[MAX_PLAYERS];"

because if you think about it CEntity Array[]; is the same as saying CEntity* Array; What''s happening is you aren''t giving it a size for the array and your making a pointer to each pointer thus the CEntity ** error (** is a double pointer)

I assume the concept your going for is to make an array of players where each element in the array points to a player. Then Do this:

CEntity* bPlayerList[MAX_PLAYERS];

And everytime you add a player do this:

bPlayerList[NumberofPlayers] = new CEntity;


SomeInfo() is just a made up function in the class CEntity (it could be anything.

Hope that helps.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!