NO

Author Topic: More STDIO Help  (Read 2516 times)

intuitas

  • Guest
More STDIO Help
« on: October 04, 2009, 06:43:00 AM »
Like Taytay I thought I would start with the simple Hello World code - here is the code I have sent to the builder (for .exe)

#include <stdio.h>

int main(void)
{
   printf("Hello World!\n");
   return 0;
}

and here is the error message I am getting

Building fone.obj.
C:\Documents and Settings\Co-ordinator\My Documents\Pelles C Projects\pone\fone.c(4): warning #2203: Function 'main' can't be __stdcall, changed to __cdecl.
Building pone.exe.
POLINK: error: Unresolved external symbol '_WinMain@16'.
POLINK: fatal error: 1 unresolved external(s).
*** Error code: 1 ***
Done.

Clearly it is related to the way I have set up my project and illustrates my lack of understanding of the relationship between project and source files, and the basic use of the IDE. Can someone please give me a kick start.

Thanks

Paul

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: More STDIO Help
« Reply #1 on: October 04, 2009, 10:35:16 AM »
Which type of project did you chose, Windows or Console EXE, empty or Wizard ???

You would need to use the empty console EXE or use the console EXE Wizard, which will create a simple "Hello World" example.
---
Stefan

Proud member of the UltraDefrag Development Team

intuitas

  • Guest
Re: More STDIO Help
« Reply #2 on: October 07, 2009, 03:51:36 PM »
Thanks Stefan,

I used the ordinary windows exe first then when I used the console the next time the source file did not seem to be added properly to the project but I think I may not have saved it first. I am up and running properly now.

Thanks again!

Paul