Results 1 to 6 of 6

Thread: error '' was not declared in this scope

  1. #1
    davinciomar Guest

    Question error '' was not declared in this scope

    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.

  2. #2
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    256
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error '' was not declared in this scope

    Please post the declaration of the class MainWindow. Where is declared capturar()?

  3. #3
    davinciomar Guest

    Default Re: error '' was not declared in this scope

    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
    Last edited by davinciomar; 23rd August 2016 at 15:28.

  4. #4
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    256
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: error '' was not declared in this scope

    Please post mainwindow.h, not the code. capturar() (and not only capturar()) seems to be undeclared. We have to see why.

  5. #5
    davinciomar Guest

    Default Re: error '' was not declared in this scope

    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
    ^
    Last edited by davinciomar; 23rd August 2016 at 16:53.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,138
    Thanks
    294
    Thanked 852 Times in 839 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: error '' was not declared in this scope

    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.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 2
    Last Post: 11th April 2016, 23:38
  2. Function not Declared in This Scope - error
    By marinskye in forum Qt Programming
    Replies: 3
    Last Post: 8th April 2016, 17:34
  3. Variable not declared in this scope error
    By hojoff79 in forum Newbie
    Replies: 1
    Last Post: 30th December 2010, 00:29
  4. Replies: 2
    Last Post: 16th July 2010, 07:17
  5. glutSolidSphere was not declared in this scope error
    By nuts_fever_007 in forum Qt Programming
    Replies: 2
    Last Post: 15th May 2009, 04:56

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.