Home  >  Q&A  >  body text

visual-studio - c++无法解析的外部符号该符号在函数 _wmain 中被引用

阿神阿神2714 days ago842

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-17 13:32:14

    The declaration of the function and the signature of the defined function are different, so it is strange to succeed. . .

    Status InitList_L(LinkList,ElemType *);//创建带头节点的单链表         -- 这是你的声明
    Status InitList_L(LinkList &L,ElemType *ptr) // !!! 第一个参数不同   -- 定义却是这样的

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:32:14

    Please try changing fun.cpp to declare.cpp

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 13:32:14

    The function declared in your declara.h has a different signature than the function you implemented in fun.cpp, and it will definitely fail

    //declar.h
    Status InitList_L(LinkList,ElemType *);//创建带头节点的单链表
    Status ListInsert_L(LinkList,int,ElemType);//在链表元素i前插入元素e
    Status ListDelete_L(LinkList,int,ElemType);//删除第i个节点,用e带回
    ElemType FindData_L(LinkList,ElemType);//查找元素n
    void MergeList_L(LinkList,LinkList);//合并两个链表
    void ListTraver_L(LinkList);//打印链表元素
    void InputList_L(ElemType *);//输入数据
    //declar.h
    //修改之后
    Status InitList_L(LinkList &, ElemType *);//创建带头节点的单链表
    Status ListInsert_L(LinkList &, int, ElemType);//在链表元素i前插入元素e
    Status ListDelete_L(LinkList &, int, ElemType &);//删除第i个节点,用e带回
    ElemType FindData_L(LinkList, ElemType);//查找元素n
    void MergeList_L(LinkList &, LinkList &);//合并两个链表
    void ListTraver_L(LinkList);//打印链表元素
    void InputList_L(ElemType *);//输入数据

    reply
    0
  • Cancelreply