I have finished programming the client-side to my new server-system for the game Crysis Wars, but however I now receive these errors:
1 2
|
Error 2 error C2208: 'CCryName' : no members defined using this type c:\program files (x86)\electronic arts\crytek\crysis wars\mods\crysiswarsmod\code\GameActions.actions 37 1 GameDll
Error 1 error C2628: 'ActionId' followed by 'char' is illegal (did you forget a ';'?) c:\program files (x86)\electronic arts\crytek\crysis wars\mods\crysiswarsmod\code\GameActions.actions 37 1 GameDll
|
I have experimented by removing functions I have programmed in, and I still have this error message.
I then started removing my #includes, and error #1 went away when I removed `#include <iostream>`, suggesting that one or more of my #includes are causing this error.
I am using the following #includes:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <StlUtils.h>
#include <StringUtils.h>
#include <iostream>
#include <sstream>
#include <comdef.h>
#include <Wbemidl.h>
#include "math.h"
#include <string>
#include <string.h>
#include <ctime>
#include <Urlmon.h>
#include <fstream>
#include <vector>
#include <sstream>
|
The `GameActions.actions` file consists entirely of lines like this:
1 2 3
|
DECL_ACTION(nextitem)
DECL_ACTION(previtem)
DECL_ACTION(small)
|
The one function in my class (in the file) is below (I removed some of the parts that need to be kept private):
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
|
void Connector::PopulateServerList()
{
string url = "[classified]";
string myUrl = "[classified]";
HRESULT hr = URLDownloadToFile(NULL, (LPCSTR)url.c_str(), (LPCSTR)myUrl.c_str(), 0, NULL);
if (hr)
{
string arr[9999][12];
std::ifstream file(myUrl);
std::string line;
int col = 0;
int row = 0;
while (std::getline(file, line))
{
std::istringstream iss(line);
std::string result;
while (std::getline(iss, result, ','))
{
arr[row][col] = result.c_str();
col = col + 1;
}
row = row + 1;
col = 0;
[private code is here]
}
}
|
I haven't much experience with C++ arrays, so
string arr[9999][12];
might be causing the problem here (an array of strings with 9999 rows and 11 columns).
What am I doing wrong here?