1,105,320 Community Members

PCH error

Member Avatar
Newbie Poster
4 posts since Apr 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
#include <iostream>
#include <fstream>
#include "Teacher.h"

using namespace std;// syntax error : missing ';' before 'PCH creation point'

teacher::teacher(int tid,int cid,char *teachname)

void teacher::setTeacherId(int tid){this->tid=tid;}
int teacher::getTeacherId(){return tid;}
void teacher::setCourseId(int cid){this->cid=cid;}
int teacher::getCourseId(){return cid;}
void teacher::setTeacherName(char *teachname){strcpy(this->teachname,teachname);}
void teacher::getTeacherName(char *teachname){strcpy(teachname,this->teachname);}
Member Avatar
Nick Evan
Industrious Poster
4,827 posts since Oct 2006
Reputation Points: 4,005 [?]
Q&As Helped to Solve: 560 [?]
Skill Endorsements: 30 [?]
Team Colleague

PCH stands for 'Pre Compiled Header', so you've created a project that requires a PCH but you didn't include it.
Just add #include "stdafx.h" as the very first line in your code.

Or turn PCH off, but since you didn't tell which compiler (version) you're using, I can't help you with that.
One more thing: if you post code here, please post it between [code=cpp] // code here [/code] tags. It makes your code easier to read and preserves formatting.

This article has been dead for over three months: Start a new discussion instead
Start New Discussion
Tags Related to this Article