LNK2019: Unresolved External Symbol

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • egewitz
    New Member
    • Mar 2007
    • 6

    #1

    LNK2019: Unresolved External Symbol

    I'm relatively new to C++. I using an expanding dynamic array to store user inputted numbers in order to calculate a standard deviation. The program compiles okay, but I get the above error. Here's the part of my code causing problems:

    [code=cpp]
    double dblEnteredSales Amount , dblStdDev;
    unsigned unsTotalNumberO fSales = 0;
    double * dblAllAgentSale s = new double[unsTotalNumberO fSales];

    cin >> dblEnteredSales Amount;
    while (dblEnteredSale sAmount != -8.88)
    {
    dblAllAgentSale s[unsTotalNumberO fSales] = dblEnteredSales Amount;
    ++unsTotalNumbe rOfSales;
    double *temp = new double[unsTotalNumberO fSales];
    for (unsigned i = 0; i < unsTotalNumberO fSales; i++)
    {
    temp[i] = dblAllAgentSale s[i];
    }
    delete [] dblAllAgentSale s;
    dblAllAgentSale s = temp;

    cin >> dblEnteredSales Amount;
    }

    dblStdDev = calcStdDev(dblA llAgentSales, dblGrandTotalSa les, unsTotalNumberO fSales);

    double calcStdDev(doub le *dblAllAgentSal es[], double dblGrandTotalSa les, unsigned unsTotalNumberO fSales)
    {
    double dblMean(0), dblSum(0), dblSale(0);
    if (unsTotalNumber OfSales > 0)
    {
    dblMean = dblGrandTotalSa les / unsTotalNumberO fSales;
    for(unsigned i = 0; i < unsTotalNumberO fSales; i++)
    {
    dblSale = *dblAllAgentSal es[unsTotalNumberO fSales];
    dblSum += pow(dblMean - dblSale, 2);
    }
    return sqrt(dblSum);
    }
    else
    {
    return 0;
    }
    }
    [/code]

    PLEASE HELP!
    Last edited by Banfa; Jun 25 '08, 09:00 PM. Reason: Added [Code=cpp]...[/code] tags
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Hi egewitz,

    I have edited your first post to include the correction you made and to add &#91;code] [/code] tags round the code.

    In order to help with the error we are going to need to know the name of the symbol that is not resolved please post the full error message.

    Comment

    • RRick
      Recognized Expert Contributor
      • Feb 2007
      • 463

      #3
      What is the symbol that is causing the problem?

      Its probably a method call that's been defined one way in a header file and another way in the source code.

      In C++, make sure the name and the parameters match exactly, or else you can get this type of error.

      Comment

      Working...