CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Unhappy HELP with link-editing error

    hi

    for whatever program who's ok at compile, i get the same error at lik-editing :

    --------------------Configuration: try2 - Win32 Debug--------------------
    Linking...
    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
    Debug/try2.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    try2.exe - 2 error(s), 0 warning(s)


    anybody can help

    i just made an instalation of visual studio 6 + sp6

    is there a bug ?


    please help

    thank you

  2. #2
    Join Date
    Mar 2004
    Location
    Israel
    Posts
    638
    the error you got is because the lack of the main function
    in win32 application.

    the function prototype is:

    int APIENTRY WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow);


    if you do not intend to use winapi then create a new workspace and choose console application.
    Last edited by Guysl; April 10th, 2004 at 02:01 PM.
    **** **** **** **** **/**

  3. #3
    Join Date
    Apr 2004
    Posts
    2

    but i have the main function

    first of all thanks for the reply, but.........


    i meant every single **** program.

    got the same error on the following prog :

    #include<stdio.h>
    void main()
    {
    printf("cannot find where is the error\n");
    }

    u c ?

  4. #4
    Join Date
    Apr 2002
    Posts
    61
    braileanul, you may still be encountering a problem with your project settings like Guys said. Try this, open a soure FILE with your example, it will ask you to create a project when you start to compile, do this, that should give you a clean project and should compile.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured