Pelles C forum
C language => Beginner questions => Topic started by: benjaminhitchcock on October 11, 2011, 03:56:03 AM
-
please help I am using a program out of my text book for Pelles and I get these two errors:
POLINK: error: Unresolved external symbol '_main.
POLINK: fatal error: 1 unresolved external(s).
-
I don't know you example, but usualy this means that you have a C program for the command line without the C default start function main.
-
Thanks my Instructor was able to put a second pair of eyes on it it and this is what was was missing : ;D ;D ;D
int
main(void)
-
Ok... I know this is only text formatting but
int
main (void)
is far less easily read than
int main(void)
The "trick" of putting the return type above the function name is often used on Unix or Linux systems because it supposedly speeds up text searches in source files. This is not the case on Windows systems and especially not in a nice ide like POIDE... Make your code more readable... don't mess with silly unix tricks.
And don't forget that an int return value means your main function ends with return 0; or an errorlevel....
The minimal skeleton is...
int main (void)
{
// your code here
return 0;
}