Results 1 to 2 of 2

Thread: Compile problem using portaudio functions

  1. #1
    Join Date
    Nov 2012
    Location
    Kentucky, USA
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    21

    Default Compile problem using portaudio functions

    I'm hoping someone can explain this error to me.
    Here's the callback function I'm building in front of the Control class:
    Qt Code:
    1. static int PaCallback(const void *input, void *output, unsigned long frameCount, const PaStreamCallbackTimeInfo* timeInfo,
    2. PaStreamCallbackFlags statusFlags, void *userData)
    3. {
    4. return 0;
    5. }
    To copy to clipboard, switch view to plain text mode 
    Then in the Control class:
    Qt Code:
    1. void Control :: openAudio()
    2. {
    3. err = Pa_OpenDefaultStream(&stream, 1, 0, paFloat32, ::sRate, 2048, PaCallback, userData);
    4. qDebug() << "pa open err = " << Pa_GetErrorText(err);
    5. }
    To copy to clipboard, switch view to plain text mode 
    The compile error is:
    C:\Development\QT_Projects\FTdxIF4\Control.cpp:450 : error: cannot convert 'Control::PaCallback' from type 'int (Control:(const void*, void*, long unsigned int, const PaStreamCallbackTimeInfo*, PaStreamCallbackFlags, void*) {aka int (Control:(const void*, void*, long unsigned int, const PaStreamCallbackTimeInfo*, long unsigned int, void*)}' to type 'int (*)(const void*, void*, long unsigned int, const PaStreamCallbackTimeInfo*, PaStreamCallbackFlags, void*) {aka int (*)(const void*, void*, long unsigned int, const PaStreamCallbackTimeInfo*, long unsigned int, void*)}'
    C:\Development\QT_Projects\FTdxIF4\Control.cpp:-1: At global scope:
    C:\Development\QT_Projects\FTdxIF4\Control.cpp:42: warning: 'int PaCallback(const void*, void*, long unsigned int, const PaStreamCallbackTimeInfo*, PaStreamCallbackFlags, void*)' defined but not used [-Wunused-function]

    I don't understand as it appears I am calling the callback function correctly.
    Can anyone explain this error? Thanks!

  2. #2
    Join Date
    Sep 2011
    Posts
    1,241
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3
    Thanked 127 Times in 126 Posts

    Default Re: Compile problem using portaudio functions

    what does this have to do with Qt programming?

    It looks like you have a member method 'PaCallback', and a free function PaCallback'?
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 10
    Last Post: 9th May 2011, 10:22
  2. Problem with virtual functions
    By eekhoorn12 in forum General Programming
    Replies: 4
    Last Post: 8th April 2010, 13:52
  3. Qt, portaudio and soundcards
    By janK in forum Newbie
    Replies: 0
    Last Post: 6th December 2009, 16:56
  4. GUI compile problem
    By waynew in forum Newbie
    Replies: 11
    Last Post: 20th October 2009, 23:06
  5. problem when trying to compile it.
    By cbarmpar in forum Qwt
    Replies: 1
    Last Post: 16th January 2009, 20:16

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
  •  
Qt is a trademark of The Qt Company.