473,385 Members | 1,553 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.

Please Help Me

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 16 '06 #1
2 1229
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 16 '06 #2
Re: Linking Error
--------------------------------------------------------------------------------

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 16 '06 #3

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

Similar topics

1
by: Numberwhun | last post by:
Hello everyone! I am trying to learn java and have run into kind of a snag. Here is the code that I have so far: ------ <begin_code> ---------- import javax.swing.*; import...
1
by: HolaGoogle | last post by:
Hi all, Please help me with the following..it's realy urgent and i tried everything i could and i can't get it work properly!! Thanks in advance. Here's what i'm trying to accomplish: in my...
0
by: s_erez | last post by:
Hi, This is a realy tricky one. I have an ASP.NET application where some pages are reading data from a DB and presenting reports. In order for the user to wait while the page is reading data from...
2
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
4
by: pshindle | last post by:
DB2 Team - I just downloaded and unzipped the new Fixpack 9 for DB2 ESE V8 for Windows (FP9_WR21350_ESE.exe). I then burned the unzipped Fixpack files to a CD. I proceded to install this...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
4
by: fatboySudsy | last post by:
Hi, I have constructed a client program that has given me some error codes that i just cannot see. I was wondering if a different set of eyes with much more experience than me could help me out. ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.