How to pass a string to a method in a class?

code
====

```
class Txtbin{
    private:
        std::string input;
        std::string output = "output.png";
        void error();

    public:
        Txtbin();
        void run();
};

Txtbin::Txtbin(){

}

void Txtbin::error(const char* str){
    throw std::runtime_error(str);
}

void Txtbin::run(){
    if(input == ""){
        error("Input file not defined");
    }
}

```

error
=====

```
# g++ -std=c++11 txtbin.cpp -o txtbin `pkg-config opencv --cflags --libs`
txtbin.cpp:30:6: error: prototype for ‘void Txtbin::error(const char*)’ does not match any in class ‘Txtbin’
 void Txtbin::error(const char* str){
      ^
txtbin.cpp:14:8: error: candidate is: void Txtbin::error()
   void error();
        ^

```