I am getting following error when I am building my C program

Discussion in 'C Programming' started by friend.05, Sep 30, 2006.

  1. friend.05

    friend.05 Guest

    I am able to compile the program, but while building it I am getting
    following error,can any explain when does this error mean.


    Command Lines
    Creating temporary file "C:\DOCUME~1\isis\LOCALS~1\Temp\RSP6E.tmp" with
    contents
    [
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
    advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
    odbccp32.lib /nologo /subsystem:windows /incremental:yes
    /pdb:"Debug/ENEE_WIN.pdb" /debug /machine:I386
    /out:"Debug/ENEE_WIN.exe" /pdbtype:sept
    ..\Debug\graph.obj
    ..\Debug\main.obj
    ]
    Creating command line "link.exe
    @C:\DOCUME~1\isis\LOCALS~1\Temp\RSP6E.tmp"
    Output Window
    Linking...
    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol
    _WinMain@16
    Debug/ENEE_WIN.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
     
    friend.05, Sep 30, 2006
    #1
    1. Advertising

  2. friend.05

    clayne Guest

    friend.05 wrote:
    > I am able to compile the program, but while building it I am getting
    > following error,can any explain when does this error mean.
    >
    > Command Lines
    > Creating temporary file "C:\DOCUME~1\isis\LOCALS~1\Temp\RSP6E.tmp" with
    > contents


    I've seen this error somewhere before. Best bet is to reformat the hard
    drive and install a unix variant on it - usually fixes it.
     
    clayne, Sep 30, 2006
    #2
    1. Advertising

  3. friend.05

    Tim Prince Guest

    friend.05 wrote:

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


    It says you haven't passed a main() .obj to the linker. Either there is
    no main() in your source or libraries, or the compile failed. As to
    the snide remarks, it is equally possible to see such a problem on other
    suggested OS.
     
    Tim Prince, Sep 30, 2006
    #3
  4. friend.05

    osmium Guest

    "friend.05" writes:

    >I am able to compile the program, but while building it I am getting
    > following error,can any explain when does this error mean.
    >
    >
    > Command Lines
    > Creating temporary file "C:\DOCUME~1\isis\LOCALS~1\Temp\RSP6E.tmp" with
    > contents
    > [
    > kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
    > advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
    > odbccp32.lib /nologo /subsystem:windows /incremental:yes
    > /pdb:"Debug/ENEE_WIN.pdb" /debug /machine:I386
    > /out:"Debug/ENEE_WIN.exe" /pdbtype:sept
    > .\Debug\graph.obj
    > .\Debug\main.obj
    > ]
    > Creating command line "link.exe
    > @C:\DOCUME~1\isis\LOCALS~1\Temp\RSP6E.tmp"
    > Output Window
    > Linking...
    > LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol
    > _WinMain@16
    > Debug/ENEE_WIN.exe : fatal error LNK1120: 1 unresolved externals
    > Error executing link.exe.


    That looks kind of familiar. Browse the existing messages on a newsgroup or
    forum or whatever related to your compiler. If you come up empty, post your
    question there.
     
    osmium, Sep 30, 2006
    #4
  5. friend.05

    clayne Guest

    Tim Prince wrote:
    > > Linking...
    > > LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol
    > > _WinMain@16

    >
    > It says you haven't passed a main() .obj to the linker. Either there is
    > no main() in your source or libraries, or the compile failed. As to
    > the snide remarks, it is equally possible to see such a problem on other
    > suggested OS.


    Pretty sure I won't be seeing unresolved errors for _WinMain on any
    serious OS I use anytime soon. :p

    Effort in, effort out.
     
    clayne, Sep 30, 2006
    #5
  6. friend.05

    jacob navia Guest

    friend.05 wrote:
    > I am able to compile the program, but while building it I am getting
    > following error,can any explain when does this error mean.
    >
    >
    > Command Lines
    > Creating temporary file "C:\DOCUME~1\isis\LOCALS~1\Temp\RSP6E.tmp" with
    > contents
    > [
    > kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
    > advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
    > odbccp32.lib /nologo /subsystem:windows /incremental:yes
    > /pdb:"Debug/ENEE_WIN.pdb" /debug /machine:I386
    > /out:"Debug/ENEE_WIN.exe" /pdbtype:sept
    > .\Debug\graph.obj
    > .\Debug\main.obj
    > ]
    > Creating command line "link.exe
    > @C:\DOCUME~1\isis\LOCALS~1\Temp\RSP6E.tmp"
    > Output Window
    > Linking...
    > LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol
    > _WinMain@16
    > Debug/ENEE_WIN.exe : fatal error LNK1120: 1 unresolved externals
    > Error executing link.exe.
    >


    Windows programs need an entry point called
    WinMain

    Programs to be run in the console use the standard main()
    procedure. Just link your program as a console application
    and you will solve this problem.
     
    jacob navia, Sep 30, 2006
    #6
  7. Tim Prince said:

    > friend.05 wrote:
    >
    >> Linking...
    >> LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol
    >> _WinMain@16
    >> Debug/ENEE_WIN.exe : fatal error LNK1120: 1 unresolved externals
    >> Error executing link.exe.
    >>

    >
    > It says you haven't passed a main() .obj to the linker.


    No, it doesn't.

    > Either there is
    > no main() in your source or libraries, or the compile failed. As to
    > the snide remarks, it is equally possible to see such a problem on other
    > suggested OS.


    Not this one.

    --
    Richard Heathfield
    "Usenet is a strange place" - dmr 29/7/1999
    http://www.cpax.org.uk
    email: rjh at above domain (but drop the www, obviously)
     
    Richard Heathfield, Sep 30, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Bonds
    Replies:
    2
    Views:
    2,750
    Amaryllis
    Aug 3, 2004
  2. Midex
    Replies:
    24
    Views:
    931
  3. Replies:
    2
    Views:
    385
  4. Pramod
    Replies:
    2
    Views:
    291
    Peter Otten
    Sep 4, 2010
  5. HP
    Replies:
    0
    Views:
    296
Loading...

Share This Page