Undefined Symbols for architecture x86_64: Compiling problems

前端 未结 1 1088
一个人的身影
一个人的身影 2020-12-04 23:39

So I am trying to start an assignment, my professor gives us a Main.cpp, Main.h, Scanner.cpp, Scanner.h, and some other utilities.

My job is to create a Similarity c

相关标签:
1条回答
  • 2020-12-04 23:57

    There's no mystery here, the linker is telling you that you haven't defined the missing symbols, and you haven't.

    Similarity::Similarity() or Similarity::~Similarity() are just missing and you have defined the others incorrectly,

    void Similarity::readData(Scanner& inStream){
    }
    

    not

    void readData(Scanner& inStream){
    }
    

    etc. etc.

    The second one is a function called readData, only the first is the readData method of the Similarity class.

    To be clear about this, in Similarity.h

    void readData(Scanner& inStream);
    

    but in Similarity.cpp

    void Similarity::readData(Scanner& inStream){
    }
    
    0 讨论(0)
提交回复
热议问题