未定义的引用,未找到架构x86_64的符号

时间:2015-09-16 07:38:57

标签: c++ undefined-reference undefined-symbol

我制作了这个简单的课程,我不知道为什么我会一直收到错误; 这是我的代码:

libgit2 returned: Invalid path for filesystem 'E:/Projects/vsteams/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-build/node_modules/decompress/node_modules/decompress-tar/node_modules/strip-dirs/node_modules/is-natural-number/is-natural-number-cjs.js': Data area passed to a system call is too small.

这是主要的:

    using namespace std;

    class Player{
    public:
        Player(string name);
        virtual ~Player();
        virtual void fight() = 0;
    private:
        string _name;
    };       


    #include "Player.h"
    #include <iostream>
    using namespace std;

    class Elf : public Player{
    public:
         Elf(string elf_name);
        ~Elf();
        void fight(){
            cout << "I kill you!" << endl;
        }
    private:
        string _elf_name;
    };

    class Dwarf : public Player{
    public:
        Dwarf(string dwarf_name);
        ~Dwarf();
        void fight(){
            cout<< "Where's The Arkengem!?" << endl;
        }
    private:
        string _dwarf_name;
    };

这是错误信息:

架构x86_64的未定义符号:

“Elf :: Elf(std :: __ 1 :: basic_string,std :: __ 1 :: allocator&gt;)”,引自:       _main in Principale.o

“Dwarf :: Dwarf(std :: __ 1 :: basic_string,std :: __ 1 :: allocator&gt;)”,引自:       在Principale.o中的_main ld:找不到架构x86_64的符号

提前谢谢。

0 个答案:

没有答案