U Avalos U Avalos - 1 year ago 56
C++ Question

Parse issue expected ')' C++ compile error

I don't see what's wrong with the following code. WordStore.cxx is defined similarly to have an empty function body. The compiler is complaining that "expected ')'" in the semstore.h function definition. I'm using XCode.
Incidentally, I'm upgrading some ancient (10+ year-old) code to compile on a modern C++ compiler.

/* WordStore.h */
#ifndef WORD_STORE_H
#define WORD_STORE_H
class WordStore

// semclass.h
#ifndef SEMCLASS_H
#define SEMCLASS_H
#include <iostream>
using namespace std;
void ReadSemRules(std::istream& stream, WordStore& ws);

// semclass.cxx
#include <iostream>
#include <string.h>
#include "WordStore.h"
#include "SemClass.h"
using namespace std;
void ReadSemRules(istream& stream, WordStore& ws)

Answer Source

You have stray unprintable character in your program between the m and the &:


void ReadSemRules(std::istream& stream, WordStore& ws);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download