Important: Please read the Qt Code of Conduct -

Include VRPN server to QT app

  • Hey,
    I need to use VRPN server in my app. I'm creating "QT Widget Application". I try to use code from this tutorial "VRPN use tutorial":, but I get too many errors. I think, I do mistake in including external VRPN .h and .c files, because when I try to run this code in Visual Studio, I get no error.

    Is here someone, who try to run QT app with VRPN server files?
    Thanks for all replies

  • Lifetime Qt Champion


    What errors are you getting ? Also can you show your pro file ?

  • My .pro file:

    Project created by QtCreator 2014-04-14T14:53:36


    QT += core

    QT -= gui

    TARGET = vrpnServer
    CONFIG += console
    CONFIG -= app_bundle

    TEMPLATE = app

    SOURCES += main.cpp

    CONFIG(release, debug|release): LIBS += -L"D:/ZCU/QT/vrpnServer" -lvrpn


    LIBS += -L$$PWD/ -lvrpn



    and when I try to run this code:
    @#include <QCoreApplication>

    #include <vrpn_Analog.h>

    using namespace std;

    void VRPN_CALLBACK handle_analog( void* userData, const vrpn_ANALOGCB a )
    int nbChannels = a.num_channel;

    cout << "Analog : ";

    for( int i=0; i < a.num_channel; i++ )
    cout <<[i] << " ";

    cout << endl;

    int main(int argc, char *argv[])
    QCoreApplication a(argc, argv);

    vrpn_Analog_Remote *vrpnAnalog = new vrpn_Analog_Remote("Mouse0@localhost");
    vrpnAnalog->register_change_handler( 0, handle_analog );
    return a.exec&#40;&#41;;


    i get error:
    @undefined reference to 'vrpn_Analog_Remote::vrpn_Analog_Remote(char const*, vrpn Connection*)'@

Log in to reply