Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8105635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:12:57+00:00 2026-06-06T00:12:57+00:00

That’s my program written in C++ (OOP): #include <iostream> #include <string> using namespace std;

  • 0

That’s my program written in C++ (OOP):

#include <iostream>
#include <string>

using namespace std;

class  book {
    string name,gvari;
    double cost;
    int year;

    public:
        book(){};

        book(string a, string b, double c, int d) { a=name;b=gvari;c=cost;d=year; }
        ~book() {}
        double setprice(double a) { return a=cost; }
        friend ostream& operator <<(ostream& , book&);
        void printbook(){
            cout<<"wignis saxeli "<<name<<endl;
            cout<<"wignis avtori "<<gvari<<endl;
            cout<<"girebuleba "<<cost<<endl;
            cout<<"weli "<<year<<endl;
        }
};

ostream& operator <<(ostream& out, book& a){
    out<<"wignis saxeli "<<a.name<<endl;
    out<<"wignis avtori "<<a.gvari<<endl;
    out<<"girebuleba "<<a.cost<<endl;
    out<<"weli "<<a.year<<endl;
    return out;
}

class library_card : public book {
    string nomeri;
    int raod;

    public:
        library_card(){};
        library_card( string a, int b){a=nomeri;b=raod;}
        ~library_card();
        void printcard(){
            cout<<"katalogis nomeri "<<nomeri<<endl;
            cout<<"gacemis raodenoba "<<raod<<endl;
        }
        friend ostream& operator <<(ostream& , library_card&);
};

ostream& operator <<(ostream& out, library_card& b) {
    out<<"katalogis nomeri "<<b.nomeri<<endl;
    out<<"gacemis raodenoba "<<b.raod<<endl;
    return out;
}


int main() {
    book A("robizon kruno","giorgi",15,1992);
    library_card B("910CPP",123);
    cout<<A;
    cout<<B;
    A.setprice(15);
    cout<<B;

    system("pause");
    return 0;
}

//P.S.
//B.printcard();
//A.printbook();
// As I've overloaded the "<<" operators, I've removed these two lines and put "cout<<A" "cout<<B". I hope, I'm right. By the way, error isn't related to these ones.

Here is the error, it may help you:

1>Neyw.obj : error LNK2019: unresolved external symbol "public: __thiscall library_card::~library_card(void)" (??1library_card@@QAE@XZ) referenced in function _main
1>c:\users\geo\documents\visual studio 2010\Projects\Newww\Debug\Newww.exe : fatal error LNK1120: 1 unresolved externals

1>Build FAILED.

The problem is I can’t figure out what’s wrong with the code.. There are two classes, the main one, book, and the successor class, library_card. Why does it give me such an error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:12:59+00:00Added an answer on June 6, 2026 at 12:12 am

    Replace

    ~library_card();
    

    with

    ~library_card() {}
    

    You haven’t implemented the destructor and this is exactly what your linker is saying.

    Or you can remove this string as well if you don’t know why you need this destructor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
That's my header: #ifndef MYCLASSES_H_ #define MYCLASSES_H_ #define ARRAY_SIZE(x) (sizeof((x)) / sizeof((x)[0])) namespace mynamespace
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am doing a simple coin flipping experiment for class that involves flipping a
That standard demos for ASP.NET MVC 3 web site user managements include the following
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That simple. Moving my layout into a fluid territory, working on scalable images. Using
That is, if my C++ application allocates memory in one thread using malloc ,
That is, on disk, if I have an array of std::complex , is it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.