Help me please

I am having an extreme problem with this program. I can get rid of some errors but then even more show up. And to top it off it wont let me force a run says the .exe file isnt found but i do not know why it is not being built.

http://www.filedropper.com/project1

I've uploaded it because it isnt just one part that is having errors. Please any help would be awesome.
The exe isn't going to be created until you build successfully... which you won't do if you have errors.

I tried to build this and I got tons of errors. It looks almost as if you coded all of this in one go without building until you wrote all of it. I don't recommend doing that... ever. You should do a build every so often just to make sure everything you wrote compiles okay. It prevents these errors from getting out of hand.


I have some free time so I'll go through these. Here are some errors in your code:

queue.h
Line 7: enum boolean{false,true}; //defining boolean type
This is nonsense and is completely unnecessary. 'false' and 'true' are already defined as type 'bool'. You do not need to create your own 'boolean' type. Just use 'bool'.


elevator.h
Line 15: Same problem. Stop trying to recreate 'bool'. Just use bool.

Line 59: You are missing a closing brace for your class


list.h

Line 8: friend class iterator<Type>; - This is a good friend declaration, but you have not established that iterator is a template. So you need to forward declare your iterator class first. You can do this by adding this above your list class definition:

 
template<typename Type> class iterator;


Line 10, 11: You have a circular inclusion problem. list.h is including node.h... but node.h is including list.h. That doesn't work. One of those headers can't include the other one .. at least not until the classes in question are defined. Remove the "node.h" include from list.h and forward declare the node class instead

Line 13: stop redefining bool. Just use bool.


iterator.h

Line 17: You are missing a semicolon after your class definition

elevator.cpp

Line 30: Your comment ends with a '\' character, which makes the next line a comment as well. Remove that \ character.

Lines 32, 45: You are using the 'i' variable but you never define it. Throw a int i; just above line 32.

Line 45: Similar problem with 'j'. j is defined only with the for loop on line 39. If you want j to exist outside of that loop, you need to define it outside that loop. Remove the definition from that loop and move it outside the loop.

Line 52: You are missing a closing brace for your 'start' function

Lines 121, 124, 127: Same problem as 'j' above. 'i' is not defined here because it's only defined for the loop on line 118. Either move the definition for i outside that loop, or redefine it for each loop.




After that, I get a successful build but I didn't try running it.
I made all your changes and i still get a ton of errors here is a list of the errors
http://www.filedropper.com/errorlistpart2

and thanks you are a life saver.

I will take your hint and not code it all at once build quite often.
I can't tell you specifically what's wrong with the code without seeing the code.
same code as before just with your changes.
I don't get any errors with my changes, so your changes must be different.
http://www.filedropper.com/project1_2

here is the link.... i do know what i did differently i followed your edits exactly.
It appears you didn't make any of the changes. All the errors are exactly the same, with all of the same fixes:

queue.h: Line 7
elevator.h: Line 15
elevator.h: missing closing brace for the class
list.h: Line 13
list.h: iterator class isn't forward declared
node.h/list.h: list.h is still including node.h, and node.h is still including list.h. One of the classes has to be forward declared
iterator.h: line 17: missing semicolon after class definition
elevator.cpp: Line 30 still are ending the comment with an escape character
elevator.cpp: Line 52 missing closing brace for function
elevator.cpp: Line 121+ Same issue with 'i' being out of scope (See earlier post)
elevator.cpp: Line 32, 39. Same issue with 'i' and 'j' being out of scope (See earlier post)



EDIT:

In fact... I just did a diff of the source, and there are 0 differences between the files you uploaded in your first post, and the files you uploaded in your most recent post. The files are 100% identical.

Are you sure you uploaded the right thing? Did you forget to save your changes or something?
Last edited on
i think i zipped up the wrong folder. try this one. i just compared them too and this one has your changes.

http://www.filedropper.com/project2_2
There are still 0 differences in the source files between this most recent upload and the source you uploaded originally:

http://imgur.com/2820Jf6
Registered users can post here. Sign in or register to post.