Advertisement

The mysterious error

Started by December 19, 2002 08:11 PM
6 comments, last by The new guy 21 years, 11 months ago
In a game I''m making I keep getting this error but I don''t have a clue what it means. I''ve tried everything to get rid of it but since I don''t know what it means is hard to get rid of. Does anybody know what it means? c:\program files\microsoft visual studio\myprojects\totalunsatisfaction\header.h(215) : error C2601: ''bed'' : local function definitions are illegal (by the way ''bed'' is one of the functions in my game, but it doesn''t have any functions in it.)
Are you attempting to write a function within another function? Don''t think that''s allowed.
Advertisement
if you have MSDN, you should use it sometimes...
Error C2601:
"The following is an example that will generate this error:


int main()
{
int i = 0;

int funcname(int j)
{
j++;
return j;
}

i = funcname(i);
return 0;
}


If you move the function into the global space, outside the main() function, the program will compile and run."

GA
Visit our homepage: www.rarebyte.de.stGA
No the function is not in another function. But one function tells the program to go to that function. I also have a variable passed through it and changed within it and then returned, would that have made a difference.
you left a closing curly-brace out somewhere.. i suggest you find it

-eldee
;another space monkey;
[ Forced Evolution Studios ]

::evolve::

Do NOT let Dr. Mario touch your genitals. He is not a real doctor!

-eldee;another space monkey;[ Forced Evolution Studios ]
Make sure that you declare your function. Within your included headers or source files.
Advertisement
I don''t think its a problem with the function because the error only is only in the programs that have the variable passed through it. What happens in the game is that you go into your bedroom and find five fire crackers and then go back to your main room where you can look into your inventory.
the variable is passed through the main program to the bedroom program and then back to main and then your inventory. All of these programs have the C2601 error.

P.S does someone have a list of what this error does.
Check what''s above the line which gives the error. You forgot a ''}'' somewhere.

If I had my way, I''d have all of you shot! codeka.com - Just click it.

This topic is closed to new replies.

Advertisement