Code::Blocks Forums
User forums => Help => Topic started by: laserbeak43 on August 17, 2007, 07:05:56 am
-
hi,
i know that this is probalby the wrong place to post this, but i'm in the mingw chatroom on irc and it's pretty dead.
i'm getting an error, that says"error: to few arguments to function 'void exit(1)'" can someone please help me with this one?
-
It is the wrong place, we're not a general programming forum.
But anyway, your error says just what it says: you use too few arguments (i.e. none at all).
Write exit(0); instead of exit(); and it will work.
Google man 2 exit for reference.
-
thanks i'll do that. cause the code i'm reading is telling me to type exit(1)
-
That will work too, just exit() will not.
The function (found in stdlib.h) is void exit(int), i.e. it takes exactly one integer, which is returned as the exit code of your program (0 is standard for "no error"). The function does not return, obviously.
-
maybe it's cause i haven't cleaned the project before i re rean it... cause i use exit(1)
nope... no luck...
could it be because the code that i'm writting is C in a C++ project? wouldn't codblocks pick this up and use the necessary compiler?
-
maybe it's cause i haven't cleaned the project before i re rean it... cause i use exit(1)
nope... no luck...
could it be because the code that i'm writting is C in a C++ project? wouldn't codblocks pick this up and use the necessary compiler?
Code::Blocks using MinGW GCC decides based on file extension. Is the file extension .c or .cpp?
Tim S
-
maybe it's cause i haven't cleaned the project before i re rean it... cause i use exit(1)
nope... no luck...
could it be because the code that i'm writting is C in a C++ project? wouldn't codblocks pick this up and use the necessary compiler?
Code::Blocks using MinGW GCC decides based on file extension. Is the file extension .c or .cpp?
Tim S
yeah i made a .cpp file to follow the book that i'm reading. it's funny cause the book tells me i need to know c++. i'll change it and see w hat happens.
in the advanced properties section, i changed the compiler options to C instead of CPP and it built itself so far. no i just gotta figure out what looks to be like a linker error to confirm it's working.