I'm trying to figure out how to get my .cpp file to #include other .cpp and .h files. Here is a little test I setup:
main.cpp:
Code:
#include "stdafx.h"
#include "test.cpp"
int main()
{
tester temp("Thins is the string");
cout<<temp.GetString();
getche();
return 0;
}
test.cpp:
Code:
#include "test.h"
string tester::GetString()
{
return teststring;
};
tester::tester(string newstring)
{
teststring = newstring;
};
test.h:
Code:
#include <iostream>
#include <conio.h>
#ifndef _TEST_H
#define _TEST_H
using namespace std;
class tester
{
public:
tester(string);
string GetString();
private:
string teststring;
};
#endif
I'm getting a couple of errors saying stuff like:
'#include "test.h"': skipped when looking for precompiled header use
binary '<<' : no operator found which takes a right-hand operand of type 'std::string'...
Thanks.