Friday, February 2

#include < vector>

What's wrong with my programme?? I spent the whole day debugging over and over again but still this error msg appeared in my compiler:
"ISO c++ forbids the declaration of 'vector' with no type"

What do u mean no type? I followed the syntax and I m positive it is correct. Its something like this: " vector < Player> playerlist" I declared "Player" as a class and it is a TYPE! Who says I declared vector without "TYPE"?? So, I wasnt satisfied, and I tried using other types like int, double, string....blah blah. And still the irritating msg appeared again:
"ISO c++ forbids the declaration of 'vector' with no type"

Stupid compiler, THOSE are clearly TYPES!!will u stop giving me these annoying msgs and just compile my programme!
"ISO c++ forbids the declaration of 'vector' with no type"

damn irritating!!
"ISO c++ forbids the declaration of 'vector' with no type"

FRUSTRATING!! HELP ME!!
"ISO c++ forbids the declaration of 'vector' with no type"

and then...I realised:

I didnt type: "#include < vector >"

zzz....

so, the problem was rectified...FINALLY!! Then I press the compile button. To my horror! rows of msgs appeared:
"expected ')' before "name" , expected ',' or ';' before "name""
"in member function 'void FullTeam::removePlayer(std::string)'"
"expected primary expression before '}' token"
"at global scope 'voit' does not have a name type"...

Then, I realised I spelt "sting" instead of "string", spelt 'voit' instead of 'void'...

Oh wells....i give up

2 comments:

Anonymous said...

Haha here are some tips from someone who has wrung his neck over retarded compiler messages many many times before :

1) VERY VERY IMPORTANT : about 50% of compiler error messages have NOTHING to do with the actual error. Some may even give you an error line number lightmillenia from the site of the actual error. So the compiler isn't a good debugging tool at all

2) Write your program in little testable bits. As in if you can write a small testable component of the program write it and compile/debug it first before moving on. If you find you need to write a whole chunk of code before you can next compile and test it then I'd recommend opening a separate file as a clipboard of sorts and write little compilable test codes on it. If the code compiles in the 'clipboard' program it should compile after inserted into your main program too. That way you can basically deal with compile time errors bit by bit systematically, and not get overwhelmed by a list if you write the whole thing then try to compile.

3) Its spelt 'program' not 'programme' :)

Anonymous said...

Oh and one more thing, consider getting a nice pirated IDE when you go back to JB. Those are nice integrated environments into which you can type your code, and if you ever mispell keywords they'll be nice enough to warn you using a squiggly line or something.

I used Microsoft Visual C++ 6 and its ok, dun get anything below 6 tho.