you need to provide more context, or we won't be able to help you, check out the thread titled "PLEASE READ THIS BEFORE POSTING A QUESTION" and you should find details about what you should minimally post in order to enable other people to try to help you.
(providing the full compile log, including a minimal self-contained, piece of source code is usually a pretty good idea)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2006-10-02
If you don't know what the problem is, then extracting the information that you think is important is a dangerous practice. Post it all - the whole compile log and at lesat all the code that prceedes this.
"Expected token" messages are normally caused by the preceeding code being in error, not the line code the message relates to. It is the preceeding code that led the compiler to expect the token. This is just the point at which its expectation was not satisfied.
Also by extracting and paraphrasing teh erro messages, you have removed important and useful diagnostic information, such as exactly what line the message is referring to.
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yeah it looks like I did forget that, thanks (i'm used to java, so i forgot it). I put the semi-colon in and I still get the same errors, though. Very strange.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The code you have posted isn't even 90 lines long, but your error refers to line 90. You have likely omitted whitespace and/or headers somewhere. You might want to clear that up.
I tried to compensate. I figure the second error might stem from the first. For some reason it doesn't like:
string getVal()
Perhaps you should investigate this. Check which headers you've included in Dbms.cpp before you include Query.h.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah i omitted stuff that i had commented out, sorry for the confusion. I got it to work though.
For some reason it didnt like bool checkVector(Vector & vec) with the parameter as a Vector (which is an object i made a template for). Anyways, I switched a bunch of my code around to just an array was being passed through checkVector and it works fine now.
Thanks to those that tried to help.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ive been messing with this for a good hour and a half and I have no idea what is wrong. For some reason the code just doesnt want to compile.
The errors I am getting are: "expected ';' before '(' token" and "expected ';' before "private"
This is inside of a the public: section of a class and right above the private: section. Heres the code-
There are a bunch of methods about checkVector and it compiles fine when I comment out the checkVector method.
Any ideas? I'm at a complete loss.
Old:
bool checkVector(Vector & vec)
Delete the space before the ampersand (&) it might be the compiler seeing a bit operator rather than... whatever you call it... an address operator?
New:
bool checkVector(Vector& vec)
you need to provide more context, or we won't be able to help you, check out the thread titled "PLEASE READ THIS BEFORE POSTING A QUESTION" and you should find details about what you should minimally post in order to enable other people to try to help you.
(providing the full compile log, including a minimal self-contained, piece of source code is usually a pretty good idea)
If you don't know what the problem is, then extracting the information that you think is important is a dangerous practice. Post it all - the whole compile log and at lesat all the code that prceedes this.
"Expected token" messages are normally caused by the preceeding code being in error, not the line code the message relates to. It is the preceeding code that led the compiler to expect the token. This is just the point at which its expectation was not satisfied.
Also by extracting and paraphrasing teh erro messages, you have removed important and useful diagnostic information, such as exactly what line the message is referring to.
Clifford
Compiler Log:
Compiler: Default compiler
Building Makefile: "C:\Project 1\Makefile.win"
Executing make...
make.exe -f "C:\Project 1\Makefile.win" all
g++.exe -c Dbms.cpp -o Dbms.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
In file included from Dbms.cpp:4:
Query.h:68: error: expected `;' before '(' token
Query.h:90: error: expected `;' before "private"
Dbms.cpp: In function `int main(int, char**)':
Dbms.cpp:217: error: 'class Query' has no member named 'checkVector'
make.exe: *** [Dbms.o] Error 1
Execution terminated
Here is Query.h in its entirity:
class Query
{
public:
private:
}
your missing the ; at the end of your class definition
for example:
class Query
{
private:
//stuff
public:
//stuff
}; //<--- that semi colon
Slooksterpsv - Shawn B.
yeah it looks like I did forget that, thanks (i'm used to java, so i forgot it). I put the semi-colon in and I still get the same errors, though. Very strange.
The code you have posted isn't even 90 lines long, but your error refers to line 90. You have likely omitted whitespace and/or headers somewhere. You might want to clear that up.
I tried to compensate. I figure the second error might stem from the first. For some reason it doesn't like:
string getVal()
Perhaps you should investigate this. Check which headers you've included in Dbms.cpp before you include Query.h.
Yeah i omitted stuff that i had commented out, sorry for the confusion. I got it to work though.
For some reason it didnt like bool checkVector(Vector & vec) with the parameter as a Vector (which is an object i made a template for). Anyways, I switched a bunch of my code around to just an array was being passed through checkVector and it works fine now.
Thanks to those that tried to help.
you might have wanted to try ommitting the reference parameter, as of course not all types of arguments can be passed by reference.