PDA

View Full Version : error '' was not declared in this scope



davinciomar
22nd August 2016, 23:36
Hi i am very frustated with this error i tried many things but i cant get to solve it. I share pictures:
https://i.imgsafe.org/b7b8a35de9.png
https://i.imgsafe.org/b7ba1aefc6.png

So if you know or you have some suggestion how to solve it pls say me.

Radek
23rd August 2016, 06:26
Please post the declaration of the class MainWindow. Where is declared capturar()?

davinciomar
23rd August 2016, 12:27
i have one question about this because my old project this code was working at the moment take me this error
class window : http://pastebin.com/dSdbMprt If you have some suggestion will be good received Thxx and sorry for all
The code where i have this method:
void MainWindow::enviarWebcam(int calidad)
{
QPixmap imagen;
imagen=capturar();
bufferWebcam.setBuffer(&WebcamMem);
bufferWebcam.open(QIODevice::WriteOnly);
imagen.save(&bufferWebcam,"jpeg",calidad);
QXmppTransferFileInfo informacion;
informacion.setName("|@|webcam|@|");
informacion.setSize(bufferWebcam.size());
bufferWebcam.close();
bufferWebcam.open(QIODevice::ReadOnly);
job = manager->sendFile(from,&bufferWebcam,informacion);

}
Normally works i dont know why doesnt work now

Radek
23rd August 2016, 16:23
Please post mainwindow.h, not the code. capturar() (and not only capturar()) seems to be undeclared. We have to see why.

davinciomar
23rd August 2016, 16:39
i declared since .cpp file webcamwin.cpp
http://pastebin.com/6XsePmSs
Sorry for changing the theme but i tried to compile again and the above error was solved. But at the moment i have one little question about one similar error:
error: 'capCreateCaptureWindowA' was not declared in this scope ::hwndVideo = capCreateCaptureWindowA("captura",WS_POPUP ,1,1 ,240 ,320,NULL,0);
The file is the same: http://pastebin.com/6XsePmSs
^

d_stranz
24th August 2016, 04:36
error: 'capCreateCaptureWindowA' was not declared in this scope ::hwndVideo = capCreateCaptureWindowA("captura",WS_POPUP ,1,1 ,240 ,320,NULL,0);

This looks like native Windows code; it has nothing to do with Qt. You have probably forgotten to #include the ".h" file where this function is declared.