chin_out 2017-10-14 12:19 采纳率: 0%
浏览 810

两个不同头文件中不同的类互相引用时出现连接问题

写了两个类在不同的头文件中

 #ifndef CUSTOMER_H_
#define CUSTOMER_H_
class Customer
{
private:
    double totle;
public:
    Customer();
    Customer(double mt);
    void save(double cush);
    int deposit(double cush);
    double get_tol();
};
typedef Customer Item;
#endif
 #ifndef QUENE_H_
#define QUENE_H_

class Quene
{
private:
    struct Node{Item item;Node *next;};
    enum{Q_Size=50};
    Node *front;
    Node *rear;
    int items;
    const int qsize;
public:
    //Quene();
    Quene(int size=Q_Size);
    ~Quene();
    bool isfull();
    bool isempty();
    int quenecount();
    bool enquene(const Item &item);
    bool dequene(Item& item);
};
#endif

报出如下错误:Error 1 error LNK1561: entry point must be defined C:\Users\asus\Desktop\quene\quene\LINK

  • 写回答

1条回答 默认 最新

  • 哲淡 2017-10-15 14:28
    关注
    1. Queue中引用了Customer, 为啥就成了互相引用了
    评论

报告相同问题?

悬赏问题

  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 关于#python#的问题:自动化测试