std::string throwing errors?

I am sure this may be some basic error, but cannot seem to find it. I don't know if it seems to be stemming from my naming of a class, but, for some reason, my compiler is throwing errors about my use of std::string. Here is one of the files it is filibustering about:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef URLCONVERTER_H
#define URLCONVERTER_H

class URLConverter
{
    private:
        std::string theURL, URLPrefix;
    public:
        URLConverter();
        URLConverter(std::string);
        //This method should allow the URL to be typed on YouTube (or anywhere else URLs are not allowed
        std::string makeURLTypableOnYouTube();
        std::string convertURL();
    protected:

};

#endif // URLCONVERTER_H 


//It throws fits about the corresponding (unfinished!) .cpp file, too! Here it is as well:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "URLConverter.h"
#include <string>

URLConverter::URLConverter()
{
    URLPrefix = "http://";
}

URLConverter::URLConverter(string siteURL)
{
    theURL = siteURL;
}

std::string URLConverter::makeURLTypableOnYouTube()
{

    return theURL;
}

std::string URLConverter::convertURL()
{

    return theURL;
}


//In this .cpp file, it is complaining about URLPrefix not being defined (it is in the same directory as the header file!) It seems like the header file cannot find the .cpp file, and either cannot find the standard namespace. Any suggestions (besides #include "URLConverter.h" , which I have done)?
The header file shall have included <string>. For example

1
2
3
4
5
6
7
8
#ifndef URLCONVERTER_H
#define URLCONVERTER_H

#include <string>

class URLConverter
{
// and so on... 
and this is because string is an object, not a primitive data type. It all makes sense now!! Thanks!!
Topic archived. No new replies allowed.