class arrow has no member named print

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • panthauts
    New Member
    • Jun 2014
    • 1

    class arrow has no member named print

    I'm a new learner facing the problem while running the class..(class arrow has no member named print)


    arrow.cpp

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

    arrow::arrow()
    {
    }

    void arrow::print(){

    cout << "this is going worse" <<endl;

    }
    ---------------------------
    arrow.h

    #ifndef ARROW_H
    #define ARROW_H


    class arrow
    {
    public:
    arrow();
    void print();
    protected:
    private:
    };

    #endif // ARROW_H

    ----------------------

    main.cpp

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


    int main(){

    arrow object;

    object.print();

    }
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    There's no problem with the code you posted. It compiles and links using Visual Studio 2013.

    Are you compiling both cpp files and passing the object files to the linker?

    Comment

    Working...