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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:14:56+00:00 2026-06-04T02:14:56+00:00

this is probably an include problem, i get these errors all over the code,

  • 0

this is probably an include problem, i get these errors all over the code, and not only for string identifier for example error C2146: syntax error : missing ';' before identifier 'getName' and error C2146: syntax error : missing ';' before identifier 'name'

here’s an example class:

#include "stdafx.h"

class participant
{
public:
participant(int id, string name);
~participant(void);

int getId();
string getName();

private:
        int id;
    string name;
};

here’s my stdafx.h file:

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <list>
#include "day.h"
#include "appointment.h"
#include "extendedAppointment.h"
#include "participant.h"
#include "calendar.h"
using namespace std;

#define no_such_appointment_error 20;
#define conflicting_appointments_error 21;
#define noSuchDayError 22;
#define incorrectAppointmentError 23;
  • 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-04T02:14:57+00:00Added an answer on June 4, 2026 at 2:14 am

    So I compiled your code as-posted without your custom header files and it worked just fine. Based on that, I am going to wager that you have a problem in one of these header files:

    #include "day.h"
    #include "appointment.h"
    #include "extendedAppointment.h"
    #include "participant.h"
    #include "calendar.h"
    

    It could be a macro, a class/struct not terminated with a semi-colon, etc. Check those out.

    Lastly, a few of tangential issues:

    First, using a namespace in a header file is a terrible idea. Any file that includes your header now has using namespace std; in it (this is bad). You probably don’t want to include that many header files in every file that includes stdafx.h.

    Secondly, once you remove that then string immediately becomes undefined (use std::string instead).

    Last, why are your #defines ended with semi-colons? No need for that.

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

Sidebar

Related Questions

I've been working all day and I somehow can't get this probably easy task
I know this probably really simple but Im not sure what im doing wrong...
I am using ASP.Net MVC but this probably applies to all MVC patterns in
I am trying to code a trival interview question of reversing a string. This
I try to get this code running. I am almost there but I got
I would like to get all the text nodes of a document, but only
This probably sounds like a terrible idea at first glance, but here is my
This probably is a dummy question but I cannot find a clear indication. I
I know this probably has been asked before but I am having issues with
Im sorry for this probably dumm question, but I want to simply open modals

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.