I have no idea

I've been working on "this" code" for about 2 hours now and for the life of me can't figure out how to fix these errors.

My functions.h file:

1
2
3
#include <string>
bool exists(string desired);
//planning on adding more, need to figure this out first 

My exists.cpp file:

1
2
3
4
5
6
7
8
9
10
11
12
13
#include "includes.h" //string, iostream, etc.
using namespace std;
bool exists(string name)
{
  if(name == true)
  {
    return true;
  }
  else
  {
    return false;
  }
}


My main.cpp file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "includes.h"
using namespace std;
int main()
{
  if(exists("Bob") == true)
  {
    //do stuff
  }
  else
  {
    //do stuff
  }
  return 0;
}

It comes up with a whole bunch of errors I can't understand sometimes and other times just a few simple errors that I can understand but don't understand why the happen. I am almost certain it has to do with string. Normally I don't use multiple files and if I wasn't this time it wouldn't be a problem, but I really want to. Thanks; Let me know if you need the actual code.
P.S. Some of the errors are like
class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > filename" (?filename@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A) already defined in exists.obj
that originate from "main.obj"
and others like
identifier 'string' is undefined
that originate from functions.cpp
but never both at once just when I make small tweaks to the code trying to fix it they alternate. Sorry if this doesn't make much sense it's kind of hard for me to explain.
closed account (48T7M4Gy)
using namespace std; should be in the .h file maybe possibly?
closed account (48T7M4Gy)
http://www.cplusplus.com/forum/beginner/194713/
Topic archived. No new replies allowed.