473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Linking Error

Hello, hello...
can somebody please help me...
I am having this problem with my source code[Linker Error] Unresolved external 'ProductList::Print(Stdctrls::TMemo *)' referenced from C:\DOCUMENTS AND SETTINGS\DOCUMENTS\DESKTOP\FOLDER\UNIT1.OBJ.
Source code is going to be devided in three parts because of its length?
PART1
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include"Product.h"
#include"ProductList.h"
#include <Dialogs.hpp>
//---------------------------------------------------------------------------
class TMainForm : public TForm
{
__published: // IDE-managed Components
TButton *Button1;
TOpenDialog *OpenDialog1;
TLabel *Label1;
TLabel *Label2;
TLabel *Label3;
TLabel *Label4;
TLabel *Label5;
TMemo *Memo1;
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
ProductList *theProduct;
public: // User declarations
__fastcall TMainForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TMainForm *MainForm;
//---------------------------------------------------------------------------
#endif

//---------------------------------------------------------------------------
#include <stdio.h>
#include <vcl.h>
#pragma hdrstop
#include<fstream.h>
#include "Unit1.h"
#include "Product.h"
#include"ProductList.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
using namespace std;

TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------

void __fastcall TMainForm::Button1Click(TObject *Sender)
{/* char buff[80];
ifstream infile("unit.txt");
if(infile.is_open())
{
while(!infile.eof())
{

infile.getline(buff,sizeof(buff));
Memo1->Lines->Add(buff);
Label1->Caption = buff;

}
}*/
theProduct->Print(Memo1);



}

//---------------------------------------------------------------------------


Thank you in Advance

Bujar METAJ
Nov 15 '06 #1
2 1729
Part2

//---------------------------------------------------------------------------

#ifndef ProductH
#define ProductH
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>

//---------------------------------------------------------------------------
class Product{
private:
char id;
char name;
double price;
double weight;
double vatPrice;

public:
//accessor function for id
char getid();
//accessor function for id
char getname();
//accessor function for id
double getprice();
//accessor function for id
double getweight();
//accessor function for id
double getvatPrice();
void products();
Product();
Product(char aid,char aname,double aprice,
double aweight, double avatPrice);
~Product();
};
#endif
#include <vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
#include <stdio.h>

#include<string>
#include<fstream.h>
#include<iostream>
#pragma hdrstop
#include "Product.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
using namespace std;

Product::Product()
{
}
Product::Product(char aid,char aname,double aprice,
double aweight, double avatPrice){
id = aid;
name = aname;
price = aprice;
weight = aweight;
vatPrice = avatPrice;
}
char Product::getid()
{
return id; }
char Product::getname()
{
return id; }
double Product::getweight(){
return weight;}
double Product::getprice(){
return price;}
double Product::getvatPrice(){
return vatPrice;}

Product::~Product(){
delete current;
}

Thank you
Nov 15 '06 #2
Part3
//---------------------------------------------------------------------------
#include <Dialogs.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Dialogs.hpp>
#include<vcl.h>
#ifndef ProductListH
#define ProductListH
#include"Product.h"
//---------------------------------------------------------------------------
class ProductList
{
private:

public:
void search();
void Print(TMemo *);
Product *Products;
Product *Start;
Product *next;
ProductList();
~ProductList();
};
#endif

//---------------------------------------------------------------------------

#include <stdio.h>
#include<fstream.h>
//---------------------------------------------------------------------------

#pragma resource "*.dfm"
#pragma package(smart_init)
#include<vcl.h>
#pragma hdrstop
#include "ProductList.h"
using namespace std;
//---------------------------------------------------------------------------
ProductList::ProductList(){
Start = new Product();
}
void ProductList::Print(TMemo *Memo1)
{

ifstream infile("food.txt");
Products = Start;
Start = NULL;
if(infile.is_open())
{
while(!infile.eof())
{
infile >> Products->getid();
infile >> Products->getname();
infile >> Products->getprice();
infile >> Products->getweight();
infile >> Products->getvatPrice();

Memo1->Lines->Add(Products->getid());
Memo1->Lines->Add(Products->getname());
Memo1->Lines->Add(Products->getprice());
Memo1->Lines->Add(Products->getweight());
Memo1->Lines->Add(Products->getvatPrice());

Products = Products->next;
Products = new Product();
Products->next = NULL;

}
}
}
ProductList::~ProductList(){
delete Start;
}

Thanks
Nov 15 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In...
3
by: Saurabh Aggrawal | last post by:
Hi, I am porting an application for 64-bit AMD processor and while linking the application i am getting the following errors: Processing directory uidll... Linking DLL...
7
by: wmkew | last post by:
Hello everyone I'm encountering a R6002 Runtime error and several bugs when trying to generate a simple Managed C++ application with .NET 2003. The main problem seems to arise from linking with...
1
by: Joannes Vermorel | last post by:
I am currently trying to port a small open source scientfic library written in C++ to .Net. The code (including the VS solution) could be found at http://www.vermorel.com/opensource/selfscaling.zip...
1
by: Kay | last post by:
I already specified to ignore specific library: MSVCPRT.lib MSVCRT.lib LIBC.lib MSVCRTD.lib LIBCD.lib command line is like: /INCREMENTAL /NOLOGO /DLL /NODEFAULTLIB:"MSVCPRT.lib MSVCRT.lib LIBC.lib...
4
by: Sanjay Kumar | last post by:
Folks ! I am working with VC++ after a long time and having problem linking latest xerces 2.7 in VC++ 2005 Express Edition. I have done following: 1. downloaded and unpacked the the...
0
by: Adam Clauss | last post by:
I have managed C++ library (is bridging between a Win32 .dll and a C# application). All was well when compiled under VS2003, but I am running into a series of linking errors when compiling...
0
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when...
0
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
0
by: dotyet | last post by:
Hi Everyone, I am trying to build a DB2 UDB UDF which can perform regex over the table data. The user defined function will call an external .dll file to do the task. I am referring to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.