C ++错误LNK2019:未解析的外部符号“public:__ thishisall

时间:2014-05-12 18:14:39

标签: c++ templates lnk2019

我确信这与我的模板有关。我对这个特定的功能非常生疏,但它可能是其他的东西,主要是因为不理解这个错误的真正含义。

我有4个错误

1>universe.obj : error LNK2019: unresolved external symbol "public: __thiscall LL<class Solar_System>::LL<class Solar_System>(void)" (??0?$LL@VSolar_System@@@@QAE@XZ) referenced in function "public: __thiscall Universe::Universe(class std::basic_fstream<char,struct std::char_traits<char> > &)" (??0Universe@@QAE@AAV?$basic_fstream@DU?$char_traits@D@std@@@std@@@Z)
1>universe.obj : error LNK2019: unresolved external symbol "public: __thiscall LL<class Solar_System>::~LL<class Solar_System>(void)" (??1?$LL@VSolar_System@@@@QAE@XZ) referenced in function __unwindfunclet$??0Universe@@QAE@AAV?$basic_fstream@DU?$char_traits@D@std@@@std@@@Z$0
1>universe.obj : error LNK2019: unresolved external symbol "public: __thiscall LL<class Empire>::LL<class Empire>(void)" (??0?$LL@VEmpire@@@@QAE@XZ) referenced in function "public: __thiscall Universe::Universe(class std::basic_fstream<char,struct std::char_traits<char> > &)" (??0Universe@@QAE@AAV?$basic_fstream@DU?$char_traits@D@std@@@std@@@Z)
1>universe.obj : error LNK2019: unresolved external symbol "public: __thiscall LL<class Empire>::~LL<class Empire>(void)" (??1?$LL@VEmpire@@@@QAE@XZ) referenced in function "public: __thiscall Universe::~Universe(void)" (??1Universe@@QAE@XZ)

universe.h

#ifndef UNIVERSE
#define UNIVERSE

#include <fstream>
#include "solar_system.h"
#include "empire.h"
#include "LL.h"
#include "race.h"

using namespace std;

class Universe{
public:
    Universe();
    Universe(fstream &save);
    ~Universe();
protected:
private:
    LL<Solar_System> list_uni_systems;
    LL<Empire> list_uni_empires;


};

#endif

LL.h

#ifndef EA_LINKEDLIST
#define EA_LINKEDLIST

#include "LL_Node.h"

template <class A>
class LL{
public:
    LL();
    ~LL();
    void add(LL_Node<A>);
    void remove();
    void next();
    void prev();
    void search(LL_Node<A>, LL_Node<A>*);
    bool find(LL_Node<A>);
    A get();
protected:
private:
    LL_Node<A> *head, *curr, *tail;
    int LL_ID_CODE;
};

#endif

如果您需要任何其他来源,请告诉我。任何帮助或指导或想法将是一个很大的帮助,谢谢

0 个答案:

没有答案