
-----------------------------------
deltatux
Sun Jan 18, 2009 7:23 pm

VS2008: Error LNK2019
-----------------------------------
Hey guys I've got some errors. My friend told me it's missing the body of my function. However, my body is obviously there when you look at this post:

pointofsales.h:

#define LIMIT 100
void posmath (int *quantity, double *price, char taxable);
void initPOS();

stdheader.h:

#include 
#include 
#include 
#include 
using namespace std;

pointofsales.cpp:

#include "stdheader.h"
#include "pointofsales.h"

void initPOS(){
	cout 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,
deltatux

-----------------------------------
OneOffDriveByPoster
Sun Jan 18, 2009 11:19 pm

Re: VS2008: Error LNK2019
-----------------------------------
Hey guys I've got some errors. My friend told me it's missing the body of my function. However, my body is obviously there when you look at this post.You function body is missing.  You have a function with the same name, but they are not the same function.

-----------------------------------
DemonWasp
Mon Jan 19, 2009 10:42 am

RE:VS2008: Error LNK2019
-----------------------------------
This is the line from pointofsales.h:

void posmath (int *quantity, double *price, char taxable); 


This is the line from libpos.cpp:

void posmath (int *quantity, double *price, char *taxable){ 


There is a subtle but very important difference between these two lines.

-----------------------------------
deltatux
Tue Jan 20, 2009 5:05 pm

RE:VS2008: Error LNK2019
-----------------------------------
Thanks, I solved it, there were also additional logic errors found.

However, once I got the compiler working I got another quirk.

http://www.imagefilez.com/out.php/i324949_Picture3.png

Source code:
/*  pointofsales.cpp
 *  Workshop1's Point of Sales program file.
 *  Copyright (C) 2009 Adrien Kwok.
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License Version 3
 *  as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see .
 *
 */

#include "stdheader.h"
#include "pointofsales.h"

void initPOS(){
	system("cls");
	cout 