Trouble with definitions in header file

Hello,
in my project I've created header file, and while compiling compiler shows an error. I have no idea how to fix it.

Functions.h
1
2
3
4
5
6
7
8
9
10
11
#ifndef FUNCTIONS_H_INCLUDED
#define FUNCTIONS_H_INCLUDED
#include <string>
void pause();
void niepoludnie();
void niepolnoc();
void niezachod();
void niewschod();
void parse(string &source);
void parse(char &source);
#endif // FUNCTIONS_H_INCLUDED 

Compiler shows following errors:

C:\Users\Malice\Desktop\SAG\functions.h|9|error: variable or field 'parse' declared void|
C:\Users\Malice\Desktop\SAG\functions.h|9|error: 'string' was not declared in this scope|
C:\Users\Malice\Desktop\SAG\functions.h|9|error: 'source' was not declared in this scope|
||=== Build finished: 3 errors, 0 warnings ===|


What am I doing wrong?
Last edited on
i believe you need std::string or add using namespace std
that should solve the second warning.
Silly me. Thank you, it works now.
closed account (zb0S216C)
You do not want to be using namespace in any header file because it can cause identifier conflicts. It's best to fully qualify standard types inside header files.

Wazzak
Last edited on
Topic archived. No new replies allowed.