Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,663 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,174 people online right now. Registration is fast and FREE... Join Now!




Help with error message :fatal error LNK1120: 1 unresolved externals

 
Reply to this topicStart new topic

Help with error message :fatal error LNK1120: 1 unresolved externals

werox51
post 6 Aug, 2008 - 02:03 PM
Post #1


New D.I.C Head

*
Joined: 6 Aug, 2008
Posts: 4

CODE
#include <iostream>            
#include <iomanip>        
#include <fstream>
using namespace std;

void process (double num, double den);
double quotient (double dvdend, double dvsor);

int main()
{
    //1. Declares a variable named inFile that represents an input stream.
    ifstream inFile;
    //2. Declares variables named dividend and divisor that hold REAL numbers.
    double dividend, divisor;
    //3. Opens the file input.txt (must be in the same folder where your program is executing).
    inFile.open ("input.txt");
    //4. if the file could not be opened
    if (!inFile)
    {
        //Prints on the screen “Could not open the input file!”
        cout << "Error opening file.\n";
        //Finishes the program returning a 1.
        return 1;
    }
    //5. Gets a couple of values from the file and stores them in dividend and divisor respectively.
    inFile>>dividend;
    inFile>>divisor;
    //6. Calls function process( ) to process these two values according to the explanation shown below.
    process(dividend,divisor);
    //7. Closes the file.
    inFile.close();
    return 0;
}
void proccess (double num, double den)
{
    //1. declares a local variable named division that holds real numbers.
    double  division;
    //2. if num is not zero
    if (den!=0)
    {
        //Assigns to division the value returned by the function called quotient( ).
        division = quotient (num, den);
        //Prints a message like the one below (fixed format with two decimal digits):
        cout<<num<<" divided by "<< den<< " is "<<division<<endl;
        //AA.AA divided by BB.BB is CC.CC
    }
    else
    {
        cout<<"Sorry, cannot solve division by zero!"<<endl;
    }
}
double quotient(double dvdend, double dvsor)
{
    double dvsion;
    dvsion = dvdend/dvsor * 100.00;
    return dvsion;
}    


can somebody help me plz im getting this error message :fatal error LNK1120: 1 unresolved externals
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 6 Aug, 2008 - 02:11 PM
Post #2


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,441



Thanked 94 times

Dream Kudos: 2625

Expert In: ruling the world.

My Contributions


You're really gonna kick yourself for this. Your function declaration is "process" but the definition is "proccess"

Here:
cpp
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;

void process (double num, double den);
double quotient (double dvdend, double dvsor);

int main()
{
//1. Declares a variable named inFile that represents an input stream.
ifstream inFile;
//2. Declares variables named dividend and divisor that hold REAL numbers.
double dividend, divisor;
//3. Opens the file input.txt (must be in the same folder where your program is executing).
inFile.open ("input.txt");
//4. if the file could not be opened
if (!inFile)
{
//Prints on the screen “Could not open the input file!”
cout << "Error opening file.\n";
//Finishes the program returning a 1.
return 1;
}
//5. Gets a couple of values from the file and stores them in dividend and divisor respectively.
inFile>>dividend;
inFile>>divisor;
//6. Calls function process( ) to process these two values according to the explanation shown below.
process(dividend,divisor);
//7. Closes the file.
inFile.close();
return 0;
}
void process (double num, double den)
{
//1. declares a local variable named division that holds real numbers.
double division;
//2. if num is not zero
if (den!=0)
{
//Assigns to division the value returned by the function called quotient( ).
division = quotient (num, den);
//Prints a message like the one below (fixed format with two decimal digits):
cout<<num<<" divided by "<< den<< " is "<<division<<endl;
//AA.AA divided by BB.BB is CC.CC
}
else
{
cout<<"Sorry, cannot solve division by zero!"<<endl;
}
}
double quotient(double dvdend, double dvsor)
{
double dvsion;
dvsion = dvdend/dvsor * 100.00;
return dvsion;
}

Hope this helps smile.gif
User is online!Profile CardPM

Go to the top of the page

NickDMax
post 6 Aug, 2008 - 02:13 PM
Post #3


2B||!2B

Group Icon
Joined: 18 Feb, 2007
Posts: 2,858



Thanked 47 times

Dream Kudos: 550
My Contributions


look at how you have spelled "process" in the function definition...

try void process (double num, double den)
User is offlineProfile CardPM

Go to the top of the page

werox51
post 6 Aug, 2008 - 02:16 PM
Post #4


New D.I.C Head

*
Joined: 6 Aug, 2008
Posts: 4

QUOTE(NickDMax @ 6 Aug, 2008 - 03:13 PM) *

look at how you have spelled "process" in the function definition...

try void process (double num, double den)


QUOTE(werox51 @ 6 Aug, 2008 - 03:15 PM) *

QUOTE(NickDMax @ 6 Aug, 2008 - 03:13 PM) *

look at how you have spelled "process" in the function definition...

try void process (double num, double den)


Thanks XD wacko.gif
User is offlineProfile CardPM

Go to the top of the page

KYA
post 6 Aug, 2008 - 06:39 PM
Post #5


#include <nerd.h>

Group Icon
Joined: 14 Sep, 2007
Posts: 4,211



Thanked 50 times

Dream Kudos: 1150
My Contributions


Usually the compiler will tell you where the issue is and that helps resolve issues.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 05:43AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month