pointofsales.h:
CODE
#define LIMIT 100
void posmath (int *quantity, double *price, char taxable);
void initPOS();
void posmath (int *quantity, double *price, char taxable);
void initPOS();
stdheader.h:
CODE
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
pointofsales.cpp:
CODE
#include "stdheader.h"
#include "pointofsales.h"
void initPOS(){
cout << "Point of Sales" << endl;
cout << "==============\n" << endl;
int quantity[LIMIT], intCount = 0;
double price[LIMIT];
char taxable[LIMIT];
do {
cout << "Quantity: ";
cin >> quantity[intCount];
if (quantity[intCount] == 0){
intCount--;
break;
}
cout << "Price: ";
cin >> price[intCount];
cout << "Taxable [y/n]: ";
cin >> taxable[intCount];
intCount++;
} while (intCount <= LIMIT);
posmath(quantity, price, *taxable);
}
#include "pointofsales.h"
void initPOS(){
cout << "Point of Sales" << endl;
cout << "==============\n" << endl;
int quantity[LIMIT], intCount = 0;
double price[LIMIT];
char taxable[LIMIT];
do {
cout << "Quantity: ";
cin >> quantity[intCount];
if (quantity[intCount] == 0){
intCount--;
break;
}
cout << "Price: ";
cin >> price[intCount];
cout << "Taxable [y/n]: ";
cin >> taxable[intCount];
intCount++;
} while (intCount <= LIMIT);
posmath(quantity, price, *taxable);
}
libpos.cpp (not finished):
CODE
#include "stdheader.h"
#include "pointofsales.h"
void posmath (int *quantity, double *price, char *taxable){
int i, tqty = 0;
double tprice = 0, sprice = 0, ptax[LIMIT], ftax[LIMIT];
for (i = 0; i <= LIMIT; i++){
tqty += quantity[i];
if (*taxable == 'y'){
ftax[i] = price[i] * 0.05;
ptax[i] = price [i] * 0.08;
}
price[i] = price[i] + ftax[i] + ptax[i];
}
}
#include "pointofsales.h"
void posmath (int *quantity, double *price, char *taxable){
int i, tqty = 0;
double tprice = 0, sprice = 0, ptax[LIMIT], ftax[LIMIT];
for (i = 0; i <= LIMIT; i++){
tqty += quantity[i];
if (*taxable == 'y'){
ftax[i] = price[i] * 0.05;
ptax[i] = price [i] * 0.08;
}
price[i] = price[i] + ftax[i] + ptax[i];
}
}
Build Error:
QUOTE
1>------ Build started: Project: Workshop2, Configuration: Debug x64 ------
1>Linking...
1>pointofsales.obj : error LNK2019: unresolved external symbol "void __cdecl posmath(int *,double *,char)" (?posmath@@YAXPEAHPEAND@Z) referenced in function "void __cdecl initPOS(void)" (?initPOS@@YAXXZ)
1>D:\devel\c++\Workshop2\x64\Debug\Workshop2.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\devel\c++\Workshop2\Workshop2\x64\Debug\BuildLog.htm"
1>Workshop2 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
1>Linking...
1>pointofsales.obj : error LNK2019: unresolved external symbol "void __cdecl posmath(int *,double *,char)" (?posmath@@YAXPEAHPEAND@Z) referenced in function "void __cdecl initPOS(void)" (?initPOS@@YAXXZ)
1>D:\devel\c++\Workshop2\x64\Debug\Workshop2.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://d:\devel\c++\Workshop2\Workshop2\x64\Debug\BuildLog.htm"
1>Workshop2 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
This is a console application, I tried both compiling it to x86 and x86_64.
Please help?
Thanks,
xboxrulz

