Jul 10, 2013 at 12:01am
its keeps saying thisclass.h is no such file or directory
please help
this is my main.cpp
#include <iostream>
#include "thisclass.h"
using namespace std;
int main()
{
thisclass tho(23)
tho.printstuff()
return 0;
}
this is my thisclass header
#ifndef THISCLASS_H
#define THISCLASS_H
class thisclass
{
public:
thisclass(int);
void printstuff();
private:
int h
};
#endif // THISCLASS_H
this the thisclass.cpp
#include "thisclass.h"
#include <iostream>
using namespace std;
hisclass::thisclass(int num)
:h(num)
{
}
cout << ""<< << endl;ttt
void thisclass::printstuff(){
cout << "h" << h << endl;
cout << "this->h" << this->h << endl;
cout << "(*this).h)" << (*this.h) << endl;
}
Jul 10, 2013 at 12:35am
look at the line under using namespace std on thisclass.cpp
Jul 10, 2013 at 12:39am
yea i saw that and fixed it already
Jul 10, 2013 at 12:40am
are they all in the same folder?
Jul 10, 2013 at 1:15am
They must not be, or you wouldn't be getting that error.
Double check the directory to make sure that they're all there.
Then double check your project to make sure you are compiling the cpp file from that directory, and not a copy of it in another directory.
Jul 10, 2013 at 1:33am
oh hey the ide could not have added the files to the project