NO

Author Topic: POLINK: error: Unresolved external symbol '_main  (Read 9636 times)

benjaminhitchcock

  • Guest
POLINK: error: Unresolved external symbol '_main
« 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).

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: POLINK: error: Unresolved external symbol '_main
« Reply #1 on: October 11, 2011, 07:23:20 AM »
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.
best regards
 Alex ;)

benjaminhitchcock

  • Guest
Re: POLINK: error: Unresolved external symbol '_main
« Reply #2 on: October 11, 2011, 04:00:40 PM »
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)

CommonTater

  • Guest
Re: POLINK: error: Unresolved external symbol '_main
« Reply #3 on: October 11, 2011, 04:06:58 PM »
Ok... I know this is only text formatting but
Code: [Select]
int
main (void)

is far less easily read than

Code: [Select]
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...
Code: [Select]
int main (void)
  {

     // your code here

     return 0;
}


   
« Last Edit: October 11, 2011, 04:09:00 PM by CommonTater »