Thread: Beginner Help

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    13
    For me this is not working im getting "undefined reference to `WinMain@16' " error.

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    23
    Quote Originally Posted by maniac20 View Post
    For me this is not working im getting "undefined reference to `WinMain@16' " error.
    im not sure why that's happening sorry, you'll have to wait for someone else to reply on that

  3. #3
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    You need a main() function, as that function is the one that automatically starts when your program is run.

  4. #4
    verbose cat
    Join Date
    Jun 2003
    Posts
    209
    Quote Originally Posted by maniac20 View Post
    For me this is not working im getting "undefined reference to `WinMain@16' " error.
    You have your compiler set up to compile the program as a windows program. You need to change your compiler's settings so it compiles as a console program. int main() is the first function a console program starts with, WinMain() is the first function a windows program starts with.

    Quote Originally Posted by space-oddity
    To print a backslash you must put a doublequote before it
    Actually, you would use a backslash before it, not a double quote. The double quote will make the compiler think you've ended your text string and that is not what you want.

    The backslash in a string makes the character immediately following it behave differently:

    Code:
    printf("\\"); /* prints \ */
    printf("\");  /* this is an error, there is no ending quote for the string */
    printf("\""); /* prints " */
    printf(""");  /* (note: 3 double quotes in a row) is an error.  */
    printf("\t"); /* prints the tab character */
    printf("t");  /* prints t */
    printf("\0"); /* prints the NULL character */
    printf("0");  /* prints 0 */
    etc.
    abachler: "A great programmer never stops optimizing a piece of code until it consists of nothing but preprocessor directives and comments "

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Same old beginner question...
    By Sharmz in forum C Programming
    Replies: 15
    Last Post: 08-04-2008, 11:48 AM
  2. What are some good beginner programs I shouold make?
    By oobootsy1 in forum C# Programming
    Replies: 6
    Last Post: 08-09-2005, 02:02 PM
  3. Books, Beginner, MustHave
    By Zeusbwr in forum C++ Programming
    Replies: 9
    Last Post: 10-25-2004, 05:14 PM
  4. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 11:21 AM