TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   linux QT Creator a error help me thanks! (http://forums.techarena.in/software-development/1269666.htm)

chhaozi 11-11-2009 12:26 PM

linux QT Creator a error help me thanks!
 
in the main.cpp
the code

int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(application);
QApplication app(argc, argv);

LinuxWebcamGrabber *linuxweb = new LinuxWebcamGrabber();
linuxweb->start();
linuxweb->getFrame(); // here error
app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
return app.exec();
}
in the otherfile
code :
......
class LinuxWebcamGrabber : public AbstractWebcamGrabber //让其成为 AbstractWebcamGrabber的子类
{
protected:
static int xioctl (int fd, int request, void *arg);

//QVector <uchar> imagebuffer;
public:
LinuxWebcamGrabber();

QImage* qimage;
int start();
int stop();
bool isGrabbingPossible();
int getFrame(QImage*); //here is the problem
..

the error show "There is no matching function"
but I have define the function in the other file
I try in main.cpp change code like this
linuxweb->getFrame(QImage*);

error :/home/haozi/distop/test-0.2.2./src/main.cpp:42: ERROR: expected primary-expression before ?*? token
there is some error with my Compiler?

Saket 11-11-2009 04:29 PM

Re: linux QT Creator a error help me thanks!
 
Thread title edited

void 11-11-2009 04:37 PM

Re: linux QT Creator a error help me thanks!
 
Quote:

Originally Posted by chhaozi (Post 4685417)
in the main.cpp

int main(int argc, char *argv[])
{
.............
linuxweb->getFrame(); // here error
......
}

Here you have not provided any value or an object. Basically the compiler will not take any value unless you have any default function that forces it to use. The above statement searches for a getFrame() which does not have any parameter inside the parenthesis (which is not available in your code).

Quote:

Originally Posted by chhaozi (Post 4685417)
in the otherfile

......

QImage* qimage;
int start();
int stop();
bool isGrabbingPossible();
int getFrame(QImage*); //here is the problem
......

the error show "There is no matching function"
but I have define the function in the other file
I try in main.cpp change code like this
linuxweb->getFrame(QImage*);

error :/home/haozi/distop/test-0.2.2./src/main.cpp:42: ERROR: expected primary-expression before ?*? token
there is some error with my Compiler?

You are getting here the problem because you cannot use "QImage" over there. "QImage" and "qimage" is different. If you want to pass some object then please note that object names are case-sensitive.

chhaozi 11-11-2009 07:38 PM

Re: linux QT Creator a error help me thanks!
 
-- much thanks !
the problem have ben kill
in the main.cpp
as void said .


All times are GMT +5.5. The time now is 12:59 AM.