Record Detail

Compile Error

In file included from /in/p3.cpp:8:0:
/in/simulation.h:1:1: error: 'ifndef' does not name a type
 ifndef __SIMULATION_H__
 ^~~~~~
In file included from /in/simulation.h:3:0,
                 from /in/p3.cpp:8:
/in/compile/world_type.h:38:7: error: 'string' does not name a type; did you mean 'stdin'?
 const string directName[] = {"east", "south", "west", "north"};
       ^~~~~~
       stdin
/in/compile/world_type.h:41:7: error: 'string' does not name a type; did you mean 'stdin'?
 const string directShortName[] = {"e", "s", "w", "n"};
       ^~~~~~
       stdin
/in/compile/world_type.h:53:7: error: 'string' does not name a type; did you mean 'stdin'?
 const string opName[] = {"hop", "left", "right", "infect",
       ^~~~~~
       stdin
/in/compile/world_type.h:73:5: error: 'string' does not name a type; did you mean 'stdin'?
     string name;
     ^~~~~~
     stdin
In file included from /in/p3.cpp:8:0:
/in/simulation.h:7:1: error: expected class-name before '{' token
 {
 ^
/in/simulation.h:13:3: error: 'position_t' does not name a type; did you mean 'direction_t'?
   position_t get_position();
   ^~~~~~~~~~
   direction_t
/in/simulation.h:29:2: error: expected ';' after class definition
 }
  ^
  ;
/in/simulation.h:32:1: error: expected class-name before '{' token
 {
 ^
/in/p3.cpp:86:1: error: expected '}' at end of input
 }
 ^
/in/p3.cpp: In member function 'int World::main(int, char**)':
/in/p3.cpp:12:3: error: 'cout' was not declared in this scope
   cout<<"Error: Missing arguments!"<<endl;
   ^~~~
/in/p3.cpp:12:3: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:12:38: error: 'endl' was not declared in this scope
   cout<<"Error: Missing arguments!"<<endl;
                                      ^~~~
/in/p3.cpp:12:38: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:14:8: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
   exit -1;
   ~~~~~^~
/in/p3.cpp:14:8: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:17:3: error: 'cout' was not declared in this scope
   cout<<"Error: Number of simulation rounds is negative!"<<endl;
   ^~~~
/in/p3.cpp:17:3: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:17:60: error: 'endl' was not declared in this scope
   cout<<"Error: Number of simulation rounds is negative!"<<endl;
                                                            ^~~~
/in/p3.cpp:17:60: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:18:8: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
   exit -2;
   ~~~~~^~
/in/p3.cpp:18:8: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:20:2: error: 'ifstream' was not declared in this scope
  ifstream iFile2;
  ^~~~~~~~
/in/p3.cpp:20:2: note: suggested alternative:
In file included from /usr/include/c++/7/ios:38:0,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/p3.cpp:1:
/usr/include/c++/7/iosfwd:162:34: note:   'std::ifstream'
   typedef basic_ifstream<char>   ifstream;
                                  ^~~~~~~~
/in/p3.cpp:21:2: error: 'iFile2' was not declared in this scope
  iFile2.open(argv[2]);
  ^~~~~~
/in/p3.cpp:23:3: error: 'cout' was not declared in this scope
   cout<<"Error: Cannot open file "<<argv[2]<<endl;
   ^~~~
/in/p3.cpp:23:3: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:23:46: error: 'endl' was not declared in this scope
   cout<<"Error: Cannot open file "<<argv[2]<<endl;
                                              ^~~~
/in/p3.cpp:23:46: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:24:8: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
   exit -3;
   ~~~~~^~
/in/p3.cpp:24:8: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:27:8: error: 'struct world_t' has no member named 'numCreature'; did you mean 'numCreatures'?
  world.numCreature=0;
        ^~~~~~~~~~~
        numCreatures
/in/p3.cpp:29:3: error: 'iFile' was not declared in this scope
   iFile>>world.r;
   ^~~~~
/in/p3.cpp:29:16: error: 'struct world_t' has no member named 'r'
   iFile>>world.r;
                ^
/in/p3.cpp:30:16: error: 'struct world_t' has no member named 'c'
   iFile>>world.c;
                ^
/in/p3.cpp:31:3: error: 'string' was not declared in this scope
   string name;
   ^~~~~~
/in/p3.cpp:31:3: note: suggested alternatives:
In file included from /usr/include/c++/7/iosfwd:39:0,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/p3.cpp:1:
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
   typedef basic_string<char>    string;
                                 ^~~~~~
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
/in/p3.cpp:32:18: error: 'name' was not declared in this scope
   getline(iFile2,name);
                  ^~~~
/in/p3.cpp:32:18: note: suggested alternative: 'rename'
   getline(iFile2,name);
                  ^~~~
                  rename
/in/p3.cpp:33:9: error: 'struct world_t' has no member named 'numCreature'; did you mean 'numCreatures'?
   world.numCreature++;
         ^~~~~~~~~~~
         numCreatures
/in/p3.cpp:34:13: error: 'struct world_t' has no member named 'numCreature'; did you mean 'numCreatures'?
   if (world.numCreature>MAXCREATURE-1){
             ^~~~~~~~~~~
             numCreatures
/in/p3.cpp:34:25: error: 'MAXCREATURE' was not declared in this scope
   if (world.numCreature>MAXCREATURE-1){
                         ^~~~~~~~~~~
/in/p3.cpp:34:25: note: suggested alternative: 'MAXCREATURES'
   if (world.numCreature>MAXCREATURE-1){
                         ^~~~~~~~~~~
                         MAXCREATURES
/in/p3.cpp:35:4: error: 'cout' was not declared in this scope
    cout<<"Error: Too many creatures!"<<endl;
    ^~~~
/in/p3.cpp:35:4: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:35:40: error: 'endl' was not declared in this scope
    cout<<"Error: Too many creatures!"<<endl;
                                        ^~~~
/in/p3.cpp:35:40: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:40:11: error: expected ';' before 'iFile1'
  ifstream iFile1;
           ^~~~~~
/in/p3.cpp:41:11: error: expected ';' before 'iFile'
  ifstream iFile[100];
           ^~~~~
/in/p3.cpp:42:9: error: 'iFile1' was not declared in this scope
         iFile1.open(argv[1]);
         ^~~~~~
/in/p3.cpp:44:3: error: 'cout' was not declared in this scope
   cout<<"Error: Cannot open file "<<argv[1]<<endl;
   ^~~~
/in/p3.cpp:44:3: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:44:46: error: 'endl' was not declared in this scope
   cout<<"Error: Cannot open file "<<argv[1]<<endl;
                                              ^~~~
/in/p3.cpp:44:46: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:45:8: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
   exit -3;
   ~~~~~^~
/in/p3.cpp:45:8: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:48:50: error: 'struct species_t' has no member named 'name'
   getline(iFile1,world.species[world.numSpecies].name);
                                                  ^~~~
/in/p3.cpp:51:4: error: 'cout' was not declared in this scope
    cout<<"Error: Too many species!"<<endl;
    ^~~~
/in/p3.cpp:51:4: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:51:38: error: 'endl' was not declared in this scope
    cout<<"Error: Too many species!"<<endl;
                                      ^~~~
/in/p3.cpp:51:38: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:53:9: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
    exit -4;
    ~~~~~^~
/in/p3.cpp:53:9: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:57:17: error: 'i' was not declared in this scope
  for (int j=0;j<i+1;j++){
                 ^
/in/p3.cpp:58:12: error: expected ';' before 'iFile'
   ifstream iFile[j];
            ^~~~~
/in/p3.cpp:59:3: error: 'iFile' was not declared in this scope
   iFile[j].open(world.species[j].name);
   ^~~~~
/in/p3.cpp:59:34: error: 'struct species_t' has no member named 'name'
   iFile[j].open(world.species[j].name);
                                  ^~~~
/in/p3.cpp:61:4: error: 'cout' was not declared in this scope
    cout<<"Error: Cannot open file "<<world.species[j].name<<endl;
    ^~~~
/in/p3.cpp:61:4: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:61:55: error: 'struct species_t' has no member named 'name'
    cout<<"Error: Cannot open file "<<world.species[j].name<<endl;
                                                       ^~~~
/in/p3.cpp:61:61: error: 'endl' was not declared in this scope
    cout<<"Error: Cannot open file "<<world.species[j].name<<endl;
                                                             ^~~~
/in/p3.cpp:61:61: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:62:9: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
    exit -3;
    ~~~~~^~
/in/p3.cpp:62:9: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:65:3: error: 'string' was not declared in this scope
   string line;
   ^~~~~~
/in/p3.cpp:65:3: note: suggested alternatives:
In file included from /usr/include/c++/7/iosfwd:39:0,
                 from /usr/include/c++/7/ios:38,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/p3.cpp:1:
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
   typedef basic_string<char>    string;
                                 ^~~~~~
/usr/include/c++/7/bits/stringfwd.h:74:33: note:   'std::__cxx11::string'
/in/p3.cpp:67:21: error: 'line' was not declared in this scope
    getline(iFile[j],line);
                     ^~~~
/in/p3.cpp:67:21: note: suggested alternative: 'uint'
    getline(iFile[j],line);
                     ^~~~
                     uint
/in/p3.cpp:68:4: error: 'istringstream' was not declared in this scope
    istringstream iStream;
    ^~~~~~~~~~~~~
/in/p3.cpp:68:4: note: suggested alternative:
In file included from /usr/include/c++/7/ios:38:0,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/p3.cpp:1:
/usr/include/c++/7/iosfwd:150:38: note:   'std::istringstream'
   typedef basic_istringstream<char>  istringstream;
                                      ^~~~~~~~~~~~~
/in/p3.cpp:69:4: error: 'iStream' was not declared in this scope
    iStream.str(line);
    ^~~~~~~
/in/p3.cpp:70:11: error: expected ';' before 'opt'
    string opt;
           ^~~
/in/p3.cpp:71:13: error: 'opt' was not declared in this scope
    iStream>>opt>>world.species[j].program[a].address;
             ^~~
/in/p3.cpp:72:10: error: 'findop' was not declared in this scope
    int i=findop(&(world.species[j].program[a].op),opt);
          ^~~~~~
/in/p3.cpp:72:10: note: suggested alternative: 'random'
    int i=findop(&(world.species[j].program[a].op),opt);
          ^~~~~~
          random
/in/p3.cpp:74:5: error: 'cout' was not declared in this scope
     cout<<"Error: Instruction "<<line<<" is not recognized!"<<endl;
     ^~~~
/in/p3.cpp:74:5: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:74:63: error: 'endl' was not declared in this scope
     cout<<"Error: Instruction "<<line<<" is not recognized!"<<endl;
                                                               ^~~~
/in/p3.cpp:74:63: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:75:10: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
     exit -6;
     ~~~~~^~
/in/p3.cpp:75:10: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:78:9: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    if (a>MAXPROGRAM-1){
        ~^~~~~~~~~~~~~
/in/p3.cpp:79:5: error: 'cout' was not declared in this scope
     cout<<"Error: Too many instructions for species "<<species[j].name<<"!"<<endl;
     ^~~~
/in/p3.cpp:79:5: note: suggested alternative:
In file included from /in/p3.cpp:1:0:
/usr/include/c++/7/iostream:61:18: note:   'std::cout'
   extern ostream cout;  /// Linked to standard output
                  ^~~~
/in/p3.cpp:79:56: error: 'species' was not declared in this scope
     cout<<"Error: Too many instructions for species "<<species[j].name<<"!"<<endl;
                                                        ^~~~~~~
/in/p3.cpp:79:56: note: suggested alternative: 'species_t'
     cout<<"Error: Too many instructions for species "<<species[j].name<<"!"<<endl;
                                                        ^~~~~~~
                                                        species_t
/in/p3.cpp:79:78: error: 'endl' was not declared in this scope
     cout<<"Error: Too many instructions for species "<<species[j].name<<"!"<<endl;
                                                                              ^~~~
/in/p3.cpp:79:78: note: suggested alternative:
In file included from /usr/include/c++/7/iostream:39:0,
                 from /in/p3.cpp:1:
/usr/include/c++/7/ostream:590:5: note:   'std::endl'
     endl(basic_ostream<_CharT, _Traits>& __os)
     ^~~~
/in/p3.cpp:81:10: error: pointer to a function used in arithmetic [-Werror=pointer-arith]
     exit -5;
     ~~~~~^~
/in/p3.cpp:81:10: error: statement has no effect [-Werror=unused-value]
/in/p3.cpp:86:1: error: no return statement in function returning non-void [-Werror=return-type]
 }
 ^
/in/p3.cpp: At global scope:
/in/p3.cpp:86:1: error: expected unqualified-id at end of input
cc1plus: all warnings being treated as errors
/in/simulation.cpp:4:11: error: missing terminating > character
 #include <
           ^
/in/simulation.cpp:4:10: error: empty filename in #include
 #include <
          ^
In file included from /in/simulation.cpp:1:0:
/in/simulation.h:1:1: error: 'ifndef' does not name a type
 ifndef __SIMULATION_H__
 ^~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:62:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/string:40,
                 from /in/compile/world_type.h:4,
                 from /in/simulation.h:3,
                 from /in/simulation.cpp:1:
/usr/include/c++/7/ext/type_traits.h:162:35: error: 'bool __gnu_cxx::__is_null_pointer' redeclared as different kind of symbol
   __is_null_pointer(std::nullptr_t)
                                   ^
/usr/include/c++/7/ext/type_traits.h:157:5: note: previous declaration 'template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)'
     __is_null_pointer(_Type)
     ^~~~~~~~~~~~~~~~~
/usr/include/c++/7/ext/type_traits.h:162:26: error: 'nullptr_t' is not a member of 'std'
   __is_null_pointer(std::nullptr_t)
                          ^~~~~~~~~
In file included from /usr/include/c++/7/bits/move.h:54:0,
                 from /usr/include/c++/7/bits/stl_pair.h:59,
                 from /usr/include/c++/7/bits/stl_algobase.h:64,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/string:40,
                 from /in/compile/world_type.h:4,
                 from /in/simulation.h:3,
                 from /in/simulation.cpp:1:
/usr/include/c++/7/type_traits:362:26: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                          ^~~
/usr/include/c++/7/type_traits:363:25: error: '_Size' was not declared in this scope
     struct is_array<_Tp[_Size]>
                         ^~~~~
/usr/include/c++/7/type_traits:363:31: error: template argument 1 is invalid
     struct is_array<_Tp[_Size]>
                               ^
/usr/include/c++/7/type_traits:561:42: error: 'nullptr_t' is not a member of 'std'
     struct __is_null_pointer_helper<std::nullptr_t>
                                          ^~~~~~~~~
/usr/include/c++/7/type_traits:561:51: error: template argument 1 is invalid
     struct __is_null_pointer_helper<std::nullptr_t>
                                                   ^
/usr/include/c++/7/type_traits:1464:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1464:61: error: template argument 1 is invalid
     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
                                                             ^
/usr/include/c++/7/type_traits:1464:61: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1469:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 0> { };
                                     ^~~~~~
/usr/include/c++/7/type_traits:1469:46: error: template argument 1 is invalid
     : public integral_constant<std::size_t, 0> { };
                                              ^
/usr/include/c++/7/type_traits:1469:46: note: invalid template non-type parameter
/usr/include/c++/7/type_traits:1471:26: error: 'std::size_t' has not been declared
   template<typename _Tp, std::size_t _Size>
                          ^~~
/usr/include/c++/7/type_traits:1472:21: error: '_Size' was not declared in this scope
     struct rank<_Tp[_Size]>
                     ^~~~~
/usr/include/c++/7/type_traits:1472:27: error: template argument 1 is invalid
     struct rank<_Tp[_Size]>
                           ^
/usr/include/c++/7/type_traits:1473:37: error: 'size_t' is not a member of 'std'
     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
                                     ^~~~~~
/usr/include/

Information

Submit By
Type
Submission
Homework
Project3: Simple World
Language
C++
Submit At
2019-10-29 23:08:54
Judged At
2019-11-06 13:40:48
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes