I\'m currently writing a C++ application which implements an Oscillator in conjuction with math.h. The code I have should work fine for the application (trying to compile an obj
Your code has multiple problems:
void oscillators::print_table()
instead of just void print_table()
) in oscillators.cpp#include "oscillators.h"
into oscillators.cppBut I guess that specific error is caused by missing semicolon after class definition in header file. Just add it like:
std::vector<double> gtable_; // Will contain a wavetable with a guard point.
};
#endif
Another way to produce this error: define a macro to a string constant, and later, use the macro name as the name of a string constant. Example
#define FOO "bar"
static const char FOO[] = "bar"; // <-- Error "expected unqualified-id before string constant".
The obvious answer is to remove one of the definitions, or change the name of one.
This is a simple problem.
You just forgot the semi colon at the end of your header file.
The compiler errors you get for missing the semi colon at the end of a class definition are very hard to relate to the actual problem - just get in the habit of checking that when you get errors after you create a class.