I am trying to compile a library, when running make I get many of the following errors:
error: conflicting declaration ‘int x’
error: ‘x’ has a previous declaration as ‘Text* x’
Here is the code:
.
.
.
class Text;
class Code {
private:
std::vector<std::string> *tokens;
std::vector<std::string> *compounds;
std::vector<std::string> *compound_xml;
std::vector<std::string> *compound_xml_action;
void set_helper(Text *x, int a, int b, int c, std::string field, std::string value);
std::string itoa(int x);
public:
Code();
~Code();
int analyse_code(Text *x, std::string c, int x, int y, int z);
int print(Text *x, std::string c, int x, int y, int z);
int is_class(Text *x, std::string c, int x, int y, int z);
int is_class2(Text *x, std::string c, int x, int y, int z);
int not_class(Text *x, std::string c, int x, int y, int z);
.
.
.
so in analyse_code function\method, should I convert int x to int a or int wtv or is it smth else causing the error?
since the author of the library has used Text* x and int x in many functions, I thought maybe he knows what he’s doing and pointers can be int, or am I wrong thinking he knows what he is doing?
Irrelevant: The library is Adso, a Chinese text analysis engine.
You have two parameters named ‘x’ in declaration like that:
Name one of them something else. For example:
The author was not very good, so beware other errors too.