Nov 3, 2014 at 12:10am UTC
I am porting the server-list of a game to my own system in order for players to connect to gameservers (since the old GameSpy system shut down in June).
I am having to access a function inside a class that currently does not have a default constructor, so I created it with
CMultiPlayerMenu() {};
, but however I am now getting this error:
Error 1 error C2036: 'SStoredServer *' : unknown size C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vector 1628 1 GameDll
I have not touched the source file where this variable (a struct) is declared in, and I have absolutely no idea why I am recieving this error.
I've searched this on the internet, but however didn't find anything relevant to my issue- what exactly is wrong and how do I fix this?
MultiplayerMenu.h:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
#ifndef __MULTIPLAYERMENU_H__
#define __MULTIPLAYERMENU_H__
#pragma once
#include "IFlashPlayer.h"
#include "MPHub.h"
struct IServerBrowser;
struct INetworkChat;
class CGameNetworkProfile;
#include "MPLobbyUI.h"
struct SStoredServer;
class CMultiPlayerMenu
{
public :
struct SGSBrowser;
struct SGSNetworkProfile;
struct SChat;
struct SCreateGame;
class CUI;
public :
CMultiPlayerMenu(bool lan, IFlashPlayer* plr, CMPHub* hub);
~CMultiPlayerMenu();
CMultiPlayerMenu() {};
bool HandleFSCommand(EGsUiCommand cmd, const char * pArgs);
std::auto_ptr<CUI> GetLobbyUI() { return m_ui; };
void OnUIEvent(const SUIEvent& event);
void DisplayServerList();
void SetServerListPos(double sb_pos);
void ChangeServerListPos(int dir);//either +1 or -1
void UpdateServerList();
void StopServerListUpdate();
void SelectServer(int id);
void JoinServer();
void ServerListUpdated();
void OnRefreshComplete(bool ok);
IServerBrowser* m_browser;
CGameNetworkProfile* m_profile;
INetworkChat* m_chat;
std::auto_ptr<CUI> m_ui;
std::auto_ptr<SGSBrowser> m_serverlist;
std::auto_ptr<SChat> m_chatlist;
std::auto_ptr<SGSNetworkProfile> m_buddylist;
std::auto_ptr<SCreateGame> m_creategame;
bool m_lan;
std::vector<SStoredServer> m_favouriteServers;
std::vector<SStoredServer> m_recentServers;
CMPHub* m_hub;
bool m_joiningServer;
EChatCategory m_selectedCat;
int m_selectedId;
};
#endif /*__MULTIPLAYERMENU_H__*/
SStoredServer
is not used in the MultiplayerMenu.cpp file.
Code for SStoredServer:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#ifndef __GAMENETWORKPROFILE_H__
#define __GAMENETWORKPROFILE_H__
#pragma once
#include "INetworkService.h"
class CMPHub;
struct SStoredServer
{
SStoredServer(uint i = 0, ushort p = 0) :ip(i), port(p){}
int ip;
int port;
bool operator ==(const SStoredServer& svr)
{
return ip == svr.ip && port == svr.port;
}
void Serialize(struct IStoredSerialize* ser);
};
#endif //__GAMENETWORKPROFILE_H__
Last edited on Nov 3, 2014 at 6:53am UTC
Nov 3, 2014 at 12:25am UTC
Sounds like std::vector wants to know its size.
Can you include SStoredServer's header at the top?
Nov 3, 2014 at 6:54am UTC
Edited the question to reflect the SStoredServer's header.
Nov 3, 2014 at 7:31am UTC
Er, I actually meant you should #include it at the top of your MultiplayerMenu.h file.
Also make sure <vector> is correctly included too.
Last edited on Nov 3, 2014 at 7:32am UTC
Nov 3, 2014 at 8:26am UTC
Ah, my mistake.
It works properly now, but however I now get another error message (even after cleaning & rebuilding):
Error 12 error LNK1136: invalid or corrupt file C:\Program Files (x86)\Electronic Arts\Crytek\Crysis Wars\BinTemp\Win32\Profile\GameDll\FlashMenuObject.obj 1 1 GameDll
Nov 3, 2014 at 12:00pm UTC
Weird you still get this error after cleaning up...
Tried manually deleting it? Note that this file is in the game's folder, maybe it's why it doesn't get cleaned up.