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 8819923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:28:59+00:00 2026-06-14T05:28:59+00:00

I am learning C++ and have a simple Date class where I am trying

  • 0

I am learning C++ and have a simple Date class where I am trying to set a value for the Date.

Here are the source code files –

Date.h

class Date{ 
private:
    int month;
    int day;
    int year;

public:
    Date();
    void setDate(int m, int d, int y);

};

and Date.cpp

#include "Date.h"

Date::Date()
{
    month = 1;
    day = 1;
    year = 80;

};

void Date :: setDate(int m1, int d1, int y1){
    month = m1;
    day = d1;
    year = y1;
};

However, when I compile the code, I get the error message –

    Undefined symbols for architecture x86_64:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status

Can someone please help ?

Thanks

  • 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-14T05:29:00+00:00Added an answer on June 14, 2026 at 5:29 am

    You’re missing a main function. Add this to either a new file (like main.cpp, and include it when compiling and linking) or to your other .cpp file.

    int main(int argc, char *argv[]) {  }
    

    And put your code to run the program in the braces.

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

Sidebar

Related Questions

I'm learning java and I have made simple program that simply reads value from
I am learning WPF and have this simple question. How do I set fill
i'm just learning java, and i meet some problems. Here we have simple factory
I have a simple request(still learning javascript). I have a title div and 3
I am learning how to use sqlite3 in python. I have a simple table
I have started learning Java and I have 1 issue: I write a simple
I'm just learning nHibernate and have come across what probably is a simple issue
I am currently learning F# and have tried (an extremely) simple example of FizzBuzz.
I am learning Servlets/JSP/MVC and have a question about architecting a simple application. I
I'm guessing this is a simple problem, but I'm just learning... I have this:

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.