Record Detail

Compile Error

In file included from /in/p3.cpp:8:0:
/in/simulation.h:15:16: error: 'world_t' was not declared in this scope
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                ^~~~~~~
/in/simulation.h:15:25: error: 'world' was not declared in this scope
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                         ^~~~~
/in/simulation.h:15:32: error: expected primary-expression before 'const'
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                ^~~~~
/in/simulation.h:15:59: error: expected primary-expression before 'const'
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                                           ^~~~~
/in/simulation.h:15:88: error: expected primary-expression before 'const'
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                                                                        ^~~~~
/in/simulation.h:15:112: error: expression list treated as compound expression in initializer [-fpermissive]
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                                                                                                ^
/in/p3.cpp: In function 'int main(int, char**)':
/in/p3.cpp:63:64: error: 'initWorld' cannot be used as a function
     if (initWorld(world, speciesFile, creaturesFile, worldsFile))
                                                                ^
/in/p3.cpp:31:10: error: unused variable 'verbose' [-Werror=unused-variable]
     bool verbose = (argc > 4 && (string(argv[4]) == "v" || string(argv[4]) == "verbose"));
          ^~~~~~~
cc1plus: all warnings being treated as errors
In file included from /in/simulation.cpp:8:0:
/in/simulation.h:15:16: error: 'world_t' was not declared in this scope
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                ^~~~~~~
/in/simulation.h:15:25: error: 'world' was not declared in this scope
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                         ^~~~~
/in/simulation.h:15:32: error: expected primary-expression before 'const'
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                ^~~~~
/in/simulation.h:15:59: error: expected primary-expression before 'const'
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                                           ^~~~~
/in/simulation.h:15:88: error: expected primary-expression before 'const'
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                                                                        ^~~~~
/in/simulation.h:15:112: error: expression list treated as compound expression in initializer [-fpermissive]
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
                                                                                                                ^
/in/simulation.cpp: In function 'bool initWorld(world_t&, const string&, const string&, const string&)':
/in/simulation.cpp:62:112: error: 'bool initWorld(world_t&, const string&, const string&, const string&)' redeclared as different kind of symbol
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile){
                                                                                                                ^
In file included from /in/simulation.cpp:8:0:
/in/simulation.h:15:6: note: previous declaration 'bool initWorld'
 bool initWorld(world_t &world, const string &speciesFile, const string &creaturesFile, const string &worldsFile);
      ^~~~~~~~~
/in/simulation.cpp:170:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for (int i=0; i<world.numSpecies; i++){
                       ~^~~~~~~~~~~~~~~~~
/in/simulation.cpp:174:24: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             else if (i = world.numSpecies-1){
                      ~~^~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:184:23: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
             else if (i=4){
                      ~^~
/in/simulation.cpp:190:28: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         if (initial_column >= world.grid.width || initial_row >= world.grid.height || initial_column < 0 || initial_row < 0){
             ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:190:63: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         if (initial_column >= world.grid.width || initial_row >= world.grid.height || initial_column < 0 || initial_row < 0){
                                                   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:239:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2024-11-15 13:13:29
Judged At
2024-11-15 13:13:29
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes