PDA

View Full Version : How to integrate QT with novint falcon



sunil.nair
5th November 2014, 05:35
Novint falcon is integrated using the HDAL SDK on Visual Studio. I could not find any documentation online to install the SDK on QT. I tried to include the HDAl library and header files in my QT project. But, the code does not run. The error is

:-1: error: No rule to make target '../imagesegment/hdl.h', needed by 'debug/main.o'. Stop.

The .pro file looks like this.3


#-------------------------------------------------
#
# Project created by QtCreator 2014-11-04T14:24:33
#
#-------------------------------------------------

QT += core

QT -= gui

TARGET = imagesegment
CONFIG += console
CONFIG -= app_bundle

TEMPLATE = app


SOURCES += main.cpp \
haptics.cpp \
gshaptics.cpp \
main_dx9.cpp \
main_opengl.cpp \
StdAfx.cpp

HEADERS += \
hdl.h \
hdlConstants.h \
hdlErrors.h \
hdlExports.h \
hdlu.h \
hdluExports.h \
adll.h \
afuncs.h \
atypes.h \
avars.h \
glut.h \
haptics.h \
StdAfx.h \
Widget.h


win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../Program Files/Novint/HDAL_SDK_2.1.3/lib/ -lhdl
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../Program Files/Novint/HDAL_SDK_2.1.3/lib/ -lhdld

INCLUDEPATH += $$PWD/../../../../Program Files/Novint/HDAL_SDK_2.1.3/include
DEPENDPATH += $$PWD/../../../../Program Files/Novint/HDAL_SDK_2.1.3/include

wysota
5th November 2014, 08:27
If you get that error then apparently your compiler cannot find the file it looks for.

ChrisW67
5th November 2014, 08:37
HEADERS should list only the files that your code, not external libraries.

You have told qmake that a file called hdl.h exists in your project (in the same place as the pro file) and needs to be pre-processed for Q_OBJECT macros etc. Qmake has dutifully written a make file rule to do that. This file does not exist in your code, and is not generated by another rule in the file, so that make rule fails when executed.

Save yourself some other possible problems and use absolute or drive relative paths in the LIBS and INCLUDEPATH. Variables.

sunil.nair
5th November 2014, 10:40
Thank you for your replies. I figured out the way. In the .pro file, I had to include the paths of the main header files, in a a format specified by the QT documentation. However, I still get this error in the haptics.cpp file.

C:\Users\haptictest\haptics.cpp:79: error: cannot convert 'const char*' to 'LPCWSTR {aka const wchar_t*}' for argument '2' to 'int MessageBoxW(HWND, LPCWSTR, LPCWSTR, UINT)'
MessageBox(NULL, "Could not open device", "Device Failure", MB_OK);


^

Added after 4 minutes:

Hey, got a solution.
http://stackoverflow.com/questions/22990044/lpcwstr-error-is-there-a-better-solution