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":http://www.vrgeeks.org/vrpn/tutorial---use-vrpn#TOC-Introduction, 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 -
Hi,
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_bundleTEMPLATE = app
SOURCES += main.cpp
CONFIG(release, debug|release): LIBS += -L"D:/ZCU/QT/vrpnServer" -lvrpn
INCLUDEPATH += $$PWD/
DEPENDPATH += $$PWD/LIBS += -L$$PWD/ -lvrpn
INCLUDEPATH += $$PWD/VRPN
DEPENDPATH += $$PWD/VRPN@
and when I try to run this code:
@#include <QCoreApplication>
#include<iostream>#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 << a.channel[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();
}
@i get error:
@undefined reference to 'vrpn_Analog_Remote::vrpn_Analog_Remote(char const*, vrpn Connection*)'@