[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - Getting started with C++

It is currently Tue Oct 23, 2018 11:40 pm Advanced search

Getting started with C++

Code won't compile? Found a bug? Post here!

Getting started with C++

Postby hb44 » Fri Feb 12, 2010 10:30 pm

I've downloaded Visual C++ Express Edition

Created a new C++ project

added MyTronBot.cc, Map.h, and Map.cc by copying from sample downloaded

When I try to compile (I assumed BUILD), I get many errors such as:

Compiling...
Map.cc
.\Map.cc(9) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(9) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
.\Map.cc(10) : error C3861: 'ReadFromFile': identifier not found
.\Map.cc(11) : warning C4508: 'Map' : function should return a value; 'void' return type assumed
.\Map.cc(13) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(13) : error C2270: 'Width' : modifiers not allowed on nonmember functions
.\Map.cc(14) : error C2065: 'map_width' : undeclared identifier
.\Map.cc(17) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(17) : error C2270: 'Height' : modifiers not allowed on nonmember functions
.\Map.cc(18) : error C2065: 'map_height' : undeclared identifier
.\Map.cc(21) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(21) : error C2270: 'IsWall' : modifiers not allowed on nonmember functions
.\Map.cc(22) : error C2065: 'map_width' : undeclared identifier
.\Map.cc(22) : error C2065: 'map_height' : undeclared identifier
.\Map.cc(25) : error C2065: 'is_wall' : undeclared identifier
.\Map.cc(29) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(29) : error C2270: 'MyX' : modifiers not allowed on nonmember functions
.\Map.cc(30) : error C2065: 'player_one_x' : undeclared identifier
.\Map.cc(33) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(33) : error C2270: 'MyY' : modifiers not allowed on nonmember functions
.\Map.cc(34) : error C2065: 'player_one_y' : undeclared identifier
.\Map.cc(37) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(37) : error C2270: 'OpponentX' : modifiers not allowed on nonmember functions
.\Map.cc(38) : error C2065: 'player_two_x' : undeclared identifier
.\Map.cc(41) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(41) : error C2270: 'OpponentY' : modifiers not allowed on nonmember functions
.\Map.cc(42) : error C2065: 'player_two_y' : undeclared identifier
.\Map.cc(45) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(54) : error C2664: 'MakeMove' : cannot convert parameter 1 from 'int' to 'const std::string &'
Reason: cannot convert from 'int' to 'const std::string'
No constructor could take the source type, or constructor overload resolution was ambiguous
.\Map.cc(58) : error C2664: 'MakeMove' : cannot convert parameter 1 from 'int' to 'const std::string &'
Reason: cannot convert from 'int' to 'const std::string'
No constructor could take the source type, or constructor overload resolution was ambiguous
.\Map.cc(62) : error C2664: 'MakeMove' : cannot convert parameter 1 from 'int' to 'const std::string &'
Reason: cannot convert from 'int' to 'const std::string'
No constructor could take the source type, or constructor overload resolution was ambiguous
.\Map.cc(66) : error C2664: 'MakeMove' : cannot convert parameter 1 from 'int' to 'const std::string &'
Reason: cannot convert from 'int' to 'const std::string'
No constructor could take the source type, or constructor overload resolution was ambiguous
.\Map.cc(77) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(82) : error C2653: 'Map' : is not a class or namespace name
.\Map.cc(84) : error C2065: 'map_width' : undeclared identifier
.\Map.cc(84) : error C2065: 'map_height' : undeclared identifier
.\Map.cc(88) : error C2065: 'is_wall' : undeclared identifier
.\Map.cc(89) : error C2065: 'map_width' : undeclared identifier
.\Map.cc(90) : error C2065: 'map_height' : undeclared identifier
.\Map.cc(93) : error C2065: 'map_height' : undeclared identifier
.\Map.cc(93) : fatal error C1903: unable to recover from previous error(s); stopping compilation
hb44
Major
 
Posts: 31
Joined: Wed Feb 10, 2010 3:46 pm

gcc ?

Postby hb44 » Fri Feb 12, 2010 10:47 pm

Where can one get the gcc compiler?

Your documentation says to use the Visual C++ Express Edition, but doesnt explain how to compile with it.

it uses subscripts of cpp not cc, and adds a lot of stuff not needed.

and of course you can't compile.
hb44
Major
 
Posts: 31
Joined: Wed Feb 10, 2010 3:46 pm

Re: gcc ?

Postby samadam » Fri Feb 12, 2010 11:45 pm

samadam
Lieutenant
 
Posts: 14
Joined: Sat Feb 06, 2010 11:13 pm

Re: Getting started with C++

Postby hb44 » Sat Feb 13, 2010 5:19 pm

The errors did not occure when the parts were added into Visual C++ in the correct order.

Compilation is accomplished with a BUILD.

But then you have to create a zipped file before you log back onto the challenge and Upload your code.

A tool to create a zipped file is available on the internet as a free download.
hb44
Major
 
Posts: 31
Joined: Wed Feb 10, 2010 3:46 pm


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 3 guests

cron