WTF C++ Problem

Started by
9 comments, last by CodeMaster000 20 years, 8 months ago
lol this is hilarious. I have no idea what is with my debugger. All of a sudden it goes wakko over a for statement. ok here my code:

for (loop=0; loop < 10; loop++)
{

}
I commented out everything but what you see and it still gives me this errors: Compiling... Game.cpp D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing ';' before 'for' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing ')' before ';' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing ';' before '<' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2501: 'loop' : missing storage-class or type specifiers D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing ';' before '<' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing ';' before '++' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2501: 'loop' : missing storage-class or type specifiers D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2086: 'loop' : redefinition D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing ';' before '++' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2059: syntax error : ')' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(14) : error C2143: syntax error : missing ';' before '{' D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(14) : error C2447: missing function header (old-style formal list?) Error executing cl.exe. I don't get it??? [edited by - codemaster000 on August 8, 2003 2:46:12 AM]
Advertisement
try:
 for (int loop = 0; loop < 10; loop++){} 
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
Same error message.. I tried that befor BTW.


Compiling...
Game.cpp
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing '';'' before ''for''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing '')'' before '';''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing '';'' before ''<''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2501: ''loop'' : missing storage-class or type specifiers
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing '';'' before ''<''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing '';'' before ''++''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2501: ''loop'' : missing storage-class or type specifiers
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2086: ''loop'' : redefinition
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2143: syntax error : missing '';'' before ''++''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(13) : error C2059: syntax error : '')''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(14) : error C2143: syntax error : missing '';'' before ''{''
D:\PROGRAMMING\C++\OPENGL\Jaguar\Game.cpp(14) : error C2447: missing function header (old-style formal list?)
Error executing cl.exe.

Game.obj - 12 error(s), 0 warning(s)
lol I found the problem... i though it might be this. I just forgot to put it into any kind of function. So it was sitting all along. UH DUH!! Lol but thank for your help!
hmmm it worked when i compiled it. maybe something wrong with your configuration?
edit: oh ok.

[edited by - TheOne1 on August 8, 2003 2:59:13 AM]
----Me: So do you know any computer languages?Friend: Ummm....yeah, I used to know l337 talk.Me: ok....
And exactly how many seconds did you look at the code before posting here?
15 min... damn deadlines don''t you hate em! thanks guys
Don''t worry about it shix like that happens drink a lot of coffee and you''ll be fine.
quote:Original post by CodeMaster000
lol I found the problem... i though it might be this. I just forgot to put it into any kind of function. So it was sitting all along. UH DUH!! Lol but thank for your help!




First time I''ve heard of anyone doing that before
-------------"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."- Charles Babbage (1791-1871)
I forgot to put 100 or more lines of code in OpenGL once. I decalred the function, but didn''t write it.

Scott Simontis
If it wasn''t for C, we''d be using BASI, PASAL and OBOL
Scott SimontisMy political blog

This topic is closed to new replies.

Advertisement