F
fl
Hi,
The following cannot be initilized. The error is LNK2001.
Bulk_item("345", 45, 3, .15);
bsk2 error LNK2001: symbole externe non r¨¦solu "public: virtual
double __thiscall Bulk_item::net_price(unsigned int)const " (?
net_price@Bulk_item@@UBENI@Z)
I don't know the reason. Could you tell me the problem? Thanks.
----------------------------
class Bulk_item : public Item_base {
public:
std:air<size_t, double> discount_policy() const
{ return std::make_pair(min_qty, discount); }
// other members as before
Bulk_item* clone() const
{ return new Bulk_item(*this); }
Bulk_item(): min_qty(0), discount(0.0) { }
Bulk_item(const std::string& book, double sales_price,
std::size_t qty = 0, double disc_rate = 0.0):
Item_base(book, sales_price),
min_qty(qty), discount(disc_rate) { }
// redefines base version so as to implement bulk purchase
discount policy
double net_price(std::size_t) const;
private:
std::size_t min_qty; // minimum purchase for discount to apply
double discount; // fractional discount to apply
};
------------
The following cannot be initilized. The error is LNK2001.
Bulk_item("345", 45, 3, .15);
bsk2 error LNK2001: symbole externe non r¨¦solu "public: virtual
double __thiscall Bulk_item::net_price(unsigned int)const " (?
net_price@Bulk_item@@UBENI@Z)
I don't know the reason. Could you tell me the problem? Thanks.
----------------------------
class Bulk_item : public Item_base {
public:
std:air<size_t, double> discount_policy() const
{ return std::make_pair(min_qty, discount); }
// other members as before
Bulk_item* clone() const
{ return new Bulk_item(*this); }
Bulk_item(): min_qty(0), discount(0.0) { }
Bulk_item(const std::string& book, double sales_price,
std::size_t qty = 0, double disc_rate = 0.0):
Item_base(book, sales_price),
min_qty(qty), discount(disc_rate) { }
// redefines base version so as to implement bulk purchase
discount policy
double net_price(std::size_t) const;
private:
std::size_t min_qty; // minimum purchase for discount to apply
double discount; // fractional discount to apply
};
------------