You are not logged in.

1

Tuesday, September 14th 2010, 3:12pm

Problems with QT Creator designed GUI to control a USB CAN Device in Ubuntu 9.04

I am using QT Creator to design a GUI that will interface with a USB CAN interface device. The company Intrepid Control Systems provided drivers on both the Linux and windows side.

I designed a fairly simple GUI that utilizes function calls to this API. The Linux shared library and windows dll both have the same named function calls.

Anyway, the windows version of the code works fine, and it compiles fine in Ubuntu once I've installed the proper libraries and changed permissions.

However, when I run the GUI, an API function call to connect to the device fails. This is strange because I can write a very simple c++ code that includes these libraries outside of Qt, compile it with a manual g++ command, and it can interface with the device just fine.

It seems Qt is compiling and accessing these libraries differently than what my simple code compiled directly with g++ did.

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#-------------------------------------------------
#
# Project created by QtCreator 2010-08-25T23:52:24
#
#-------------------------------------------------

QT   	+= core gui

TARGET = TestProject2
TEMPLATE = app

win32 {
SOURCES += main.cpp\
    	mainwindow.cpp \
    	icsneo40DLLAPI.cpp

HEADERS  += mainwindow.h \
	icsnVC40.h \
	icsSpyData.h \
	icsneo40DLLAPI.h

}

FORMS	+= mainwindow.ui


unix {
LIBS +=   -L/usr/lib/  -licsneoAPI  -lrt

HEADERS  += mainwindow.h \
	icsnVC40.h \
	icsSpyData.h \
	icsneoLinuxAPI.h

SOURCES += main.cpp \
    	mainwindow.cpp

}


Does anyone know how Qt Creator could be compiling these libraries differently, thus breaking the function calls to connect to this device?
If any other information is needed, let me know.
My g++ command (using a different, gui-less main.cpp) is something like:
g++ -L/usr/lib/ -licsneoAPI -lrt -o TestProject main.cpp
That main.cpp uses the same api calls (to the icsneoAPI library mainly), and it connects to the device properly.

Thanks.

2

Wednesday, July 6th 2011, 5:05pm

Hi,

i'm trying to use the same interface with Qt...
can you explain me how you add intrepid dll .cpp and .h to qt ?

Thanks so much,

Riccardo