expected ")" before "*" token.

i`ve been trying to solve the following problems for ages. I really hope someone can help me. Really grateful for all help!

I got the following errors (According errors?):
1. expected class-name before { token
2. expected ")" before "*" token.
in file included from ..\testMapp\main.cpp:6.0:

according to the compiler, the first error (1) comes from line 13 and the second error from line 16 in the following code: http://pastebin.com/UZj7K8rX

Other header files:
Mainwindow: http://pastebin.com/mtqGZJ91
Qcustomplot.h: http://pastebin.com/s7PZfxPK

Thank you in advance for all help!
Shouldn't it just be MainWindow?
Clearly, it's not understanding the meaning of QMainWindow.

This probably means one of the following:

- You've failed to include the header file that contains the definition of QMainWindow
- QMainWindow is defined within a namespace, so you need to add a namespace qualifier
- You've misspelled the name of the class
Thanks for the fast reply. I cant see any of the problems that MikeyBoy is mentioning. However: in graph.cpp i get the following error in QT : Could not decode "graph.cpp" with "UTF-8" encoding. May this cause the problem(s)?

Here is relevant parts of graph.cpp: http://pastebin.com/cwahgmBr
OOooh, thanks alot! That was a easy one.

Once more, i got a new error...: in this code: http://pastebin.com/2YdAZetp

In member function "void QCPAcis::setNumberFormat(const QString&);
"const class QChar" has no member named "toAscii"

I got the code from QTs website...

hope this is the last error message, but something tells me it is not.
OOooh, thanks alot! That was a easy one.

And, indeed, was the first of my suggestions.
In member function "void QCPAcis::setNumberFormat(const QString&);
"const class QChar" has no member named "toAscii"

Hmm. According to http://qt-project.org/doc/qt-4.8/qchar.html it does.
Ease too.
In function you declare
void QCPAxis::setNumberFormat(const QString &formatCode)
so it means that variable formatCode is constant and can not be modified. But this line
formatCode.at(0).toAscii(); tries to modify it. You need to copy data from formatCode.at(0) to mNumberFormatChar and use mNumberFormatChar.toAscii()
At last I think so ;)

QString have member named "toAscii", but const QString do not have member named "toAscii"

char toAscii() const (deprecated)
Last edited on
According to the reference, QChar::toAscii() is a const method. So it isn't trying to modify anything.

Edit: QString::at() is also const.
Last edited on
Ok, i am sick of this code and i give up. If anybody care to fix the program and send me release version for some money, shout out.
The program worked well in QT v: 2.4.1 in 2.6.2 i got all the errors.

Last edited on
Topic archived. No new replies allowed.