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

    Requesting help for error LNK2001



    I get the following error when I compile a simple console application in Visual C++:

    Linking...

    LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16

    I've read the documentation but I can't seem to find my error - lthough I must admit I'm a beginner and don't know a

    lot of the concepts mentioned. Here's my main application if anyone sees anything obvious that I might be doing wrong

    please let me know.

    #include "TopoSort.h" // this file includes

    // <stdlib.h>,<iostream.h>,<fstream.h>

    ... // and others

    // a bunch of functions here

    ...

    int main (void) // main routine

    {

    int x=1; // used for keyboard control of while

    ofstream fout; // an output file

    AdjList AL; // an adjacency list

    int DFmax=1;

    ifstream fin; // an input file

    char fileName[10]; // a file name

    fout.open("out.txt" // prepare output file

    while (x)

    {

    cout << "Enter file name: "; // print a message

    cin >> fileName;

    fin.open(fileName); // open that file

    if (!fin)

    {

    cout << "Cannot open "<< fileName << ".";

    return 0;

    }

    GetData(AL,fout,fin); // get adjacency list data

    //******variable definitions for each set of data***********

    Array InvDFnum(AL.Size); // the inverse of DF numbering //(to

    find vertex)

    Array DFnum(AL.Size); // the DF numbering

    Array LowPt(AL.Size); // the low points

    Init(DFnum,InvDFnum,LowPt);

    //************************************************

    // DFnumbering(fout,1,AL,DFnum,DFmax);

    DFmax=1;

    DFS(fout,1,AL,DFnum,LowPt,DFmax,InvDFnum);

    fout<<"----------------------------------------"<<endl;

    cout<< "press 0 to quit:";

    cin >>x;

    }//end while

    fout.close();

    fout<<"Output written to file: out.txt"<<endl;

    return 1;

    } // end of main()





  2. #2
    Join Date
    May 1999
    Location
    Antwerp, Belgium
    Posts
    136

    Re: Requesting help for error LNK2001



    Make a new workspace Win32 Console Application with an empty project.

    Propably you specified something that needs a WinMain() (like MFC, ...) instead of the main().



  3. #3
    Join Date
    Mar 1999
    Posts
    4

    Re: Requesting help for error LNK2001



    I am grateful for your response. Thank you.


    This did indeed work.


    Diana

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