• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Fix vector errors!

Status
Not open for further replies.
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
27
Reaction score
0
I have spent a LOT of time trying to figure out why I kept getting this error:

error C2061: syntax error : identifier 'vector'

And I have finally figured it out! (This should also slow down server crashes.)

Go to PlayersPacket.h and find this:

Code:
    static void showMoving(Player* player, vector <Player*> players, unsigned char* packet, int size);
    static void faceExperiment(Player* player, vector <Player*> players, int face);
    static void showChat(Player* player, vector <Player*> players, char* msg);
    static void damagePlayer(Player* player, vector <Player*> players, int dmg, int mob);

Replace with:

Code:
    static void showMoving(Player* player, std::vector <Player*> players, unsigned char* packet, int size);
    static void faceExperiment(Player* player, std::vector <Player*> players, int face);
    static void showChat(Player* player, std::vector <Player*> players, char* msg);
    static void damagePlayer(Player* player, std::vector <Player*> players, int dmg, int mob);

Save and build it again and it will work.
 
Experienced Elementalist
Joined
Apr 2, 2008
Messages
255
Reaction score
0
Re: [RELEASE] Fix vector errors!

lol error compiling goo job
1>------ Build started: Project: MapleStoryServer, Configuration: Debug Win32 ------
1>Compiling...
1>Player.cpp
1>c:\users\alejandro\desktop\007\maplestoryserver\playerspacket.h(9) : error C2955: 'std::vector' : use of class template requires template argument list
1> c:\program files\microsoft visual studio 9.0\vc\include\vector(438) : see declaration of 'std::vector'
1>Build log was saved at "file://c:\Users\Alejandro\Desktop\007\MapleStoryServer\Debug\BuildLog.htm"
1>MapleStoryServer - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

btw the code i have to remplace is diferent than urs look

static void showMoving(Player* player, vector <Player*> players, unsigned char* packet, int size);
static void faceExperiment(Player* player, vector <Player*> players, int face);
static void showChat(Player* player, vector <Player*> players, char* msg);
static void damagePlayer(Player* player, vector <Player*> players, int dmg, int mob);
 
Junior Spellweaver
Joined
Sep 29, 2005
Messages
143
Reaction score
0
Re: [RELEASE] Fix vector errors!

compiles fine

here




#ifndef PLAYERSPACK_H
#define PLAYERSPACK_H

class Player;
class Packet;

class PlayersPacket {
public:
static void showMoving(Player* player, std::vector <Player*> players, unsigned char* packet, int size);
static void faceExperiment(Player* player, std::vector <Player*> players, int face);
static void showChat(Player* player, std::vector <Player*> players, char* msg);
static void damagePlayer(Player* player, std::vector <Player*> players, int dmg, int mob);
static void showMassage(char* msg, char type);
static void showInfo(Player* player, Player* getinfo);
};

#endif
 
Newbie Spellweaver
Joined
Oct 5, 2007
Messages
47
Reaction score
0
Re: [RELEASE] Fix vector errors!

Seems to work fine but... What does the std:: does?

Here's my code btw, it seems the one he pasted don't have the "<"s and the ">"s xD.

#ifndef PLAYERSPACK_H
#define PLAYERSPACK_H

class Player;
class Packet;

class PlayersPacket {
public:
static void showMoving(Player* player, std::vector <Player*> players, unsigned char* packet, int size);
static void faceExperiment(Player* player, std::vector <Player*> players, int face);
static void showChat(Player* player, std::vector <Player*> players, char* msg);
static void damagePlayer(Player* player, std::vector <Player*> players, int dmg, int mob);
static void showMassage(char* msg, char type);
static void showInfo(Player* player, Player* getinfo);
static void showNoticeOneChar(char* msg, char type, Player* player);
};

#endif
 
Newbie Spellweaver
Joined
Apr 10, 2008
Messages
27
Reaction score
0
Re: [RELEASE] Fix vector errors!

Seems to work fine but... What does the std:: does?

Here's my code btw, it seems the one he pasted don't have the "<"s and the ">"s xD.



Here is a link to the C++ Documentation:

https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/coding/295.html

C++ programmers have the option of using the standard std::string class defined in ISO/IEC 14882. The std::string generally protects against buffer overflow.

I don't see a difference between the two. Where am I missing "<"s and ">"s?
 
Junior Spellweaver
Joined
Nov 23, 2004
Messages
125
Reaction score
2
Re: [RELEASE] Fix vector errors!

using namespace std;

lol
 
Banned
Banned
Joined
Apr 6, 2008
Messages
120
Reaction score
0
Re: [RELEASE] Fix vector errors!


not sure what the difference was, but this one worked for me, although i had to take out ur shownotice at the bottom, cuz i dotn have that
 
Experienced Elementalist
Joined
Apr 13, 2008
Messages
211
Reaction score
0
Re: [RELEASE] Fix vector errors!

yay!
but i see ppl say they got errors
i hope this will work...
 
Experienced Elementalist
Joined
Jan 10, 2008
Messages
224
Reaction score
27
Re: [RELEASE] Fix vector errors!

using namespace std;

And why did you delete it?
 
Newbie Spellweaver
Joined
Apr 14, 2008
Messages
58
Reaction score
0
Re: [RELEASE] Fix vector errors!

i got no errors while i compile them
 
Newbie Spellweaver
Joined
Apr 1, 2008
Messages
79
Reaction score
2
Re: [RELEASE] Fix vector errors!

Compile fine tyvm :winky:
 
Newbie Spellweaver
Joined
Mar 19, 2006
Messages
50
Reaction score
59
Re: [RELEASE] Fix vector errors!

The whole "using namespace std;" means that you don't have to prepend "std::" when using a "vector".

Posting non-sense like this just confuses and over complicates things.
 
Newbie Spellweaver
Joined
Apr 13, 2008
Messages
48
Reaction score
0
Re: [RELEASE] Fix vector errors!

Heres mine, combined the original with this one, compiles fine:
Code:
#ifndef PLAYERSPACK_H
#define PLAYERSPACK_H

class Player;
class Packet;

class PlayersPacket {
public:
static void showMoving(Player* player, std::vector <Player*> players, unsigned char* packet, int size);
static void faceExperiment(Player* player, std::vector <Player*> players, int face);
static void showChat(Player* player, std::vector <Player*> players, char* msg);
static void damagePlayer(Player* player, std::vector <Player*> players, int dmg, int mob);
static void showMassage(char* msg, char type);
static void showInfo(Player* player, Player* getinfo);
static void PlayersPacket::ShowNotice(Player* player, char* msg, char type);
};

#endif
 
Junior Spellweaver
Joined
Sep 20, 2007
Messages
138
Reaction score
0
Re: [RELEASE] Fix vector errors!

alternatively, stop being a noob, delete all the std:: and start using:
Code:
using namespace std;
=.=
 
Newbie Spellweaver
Joined
Feb 19, 2008
Messages
33
Reaction score
0
Re: [RELEASE] Fix vector errors!

Can anyone explain what the hell this does besides add std:: to a couple of lines
 
Initiate Mage
Joined
May 12, 2008
Messages
2
Reaction score
0
Re: [RELEASE] Fix vector errors!

error C2871: 'std' : a namespace with this name does not exist

And no, using namespace std; doesn't work for me, I hate Vc++ compiler ._.
 
Status
Not open for further replies.