PDA

View Full Version : Serial Port programming not working with any library



kpkale
21st December 2011, 13:13
I have downloaded the latest version of QT4 and the SDK and I am using it on Ubuntu 10.04.
That is working perfectly OK.

On studying all the forums and help online I could find out 3 projects that are used for accessing the serial port in QT.
qextserialport, qserialdevice and a very lesser known qport.

QEXTSERIALPORT:
I have downloaded the qextserialport-1.1.tar.gz file and unzipped in a folder.
THen i open the .pro file in directory and give Build All in the QT Creator.
I get the following... and no DLL's are created.

Starting /home/kpkale/Programs/Downloaded Examples/qextserialport/examples/event/event...
/home/kpkale/Programs/Downloaded Examples/qextserialport/examples/event/event: error while loading shared libraries: libqextserialport.so.1: cannot open shared object file: No such file or directory
/home/kpkale/Programs/Downloaded Examples/qextserialport/examples/event/event exited with code 127


I am stuck up here as I did not get a valid solution to get this thing working...
//************************************************** ****
I also used another method as shown in this link
http://code.google.com/p/aileron/source/browse/wiki/ProjectOnboardingDevelopers.wiki?r=324

Here, first is could not understand how to differntly do "Manually build the qextserialport project." and moreover, I could not proceed to downloading the telem project... dont have experience on downloading using svn...


QSERIALDEVICE:
I have downloaded the tar file from this link.
http://qt-apps.org/content/show.php?content=112039

I unzipped it in a folder and then opened the BuildLIbaray.pro in QTCreator. WHen I give Build ALL It gives me a lot of errors and below.

qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:35:25: error: libudev.h: No such file or directory
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp: In constructor 'SerialDeviceEnumeratorPrivate::SerialDeviceEnumer atorPrivate()':
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:52: error: '::udev_new' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:61: error: '::udev_monitor_new_from_netlink' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:70: error: '::udev_monitor_filter_add_match_subsystem_devtype ' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:71: error: '::udev_monitor_enable_receiving' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:72: error: '::udev_monitor_get_fd' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp: In destructor 'virtual SerialDeviceEnumeratorPrivate::~SerialDeviceEnumer atorPrivate()':
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:107: error: '::udev_monitor_unref' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:110: error: '::udev_unref' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp: In member function 'SerialInfoMap SerialDeviceEnumeratorPrivate::updateInfo() const':
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:158: error: '::udev_enumerate_new' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:169: error: '::udev_enumerate_add_match_subsystem' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:170: error: '::udev_enumerate_scan_devices' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:172: error: '::udev_enumerate_get_list_entry' has not been declared
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:174: error: 'udev_list_entry_foreach' was not declared in this scope
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:174: error: expected ';' before '{' token
qserialdeviceenumerator/serialdeviceenumerator_p_unix.cpp:252: error: expected '}' at end of input
make[1]: Leaving directory `/home/kpkale/Programs/Downloaded Examples/qserialdevice-qserialdevice-new2/src'
make[1]: *** [build/obj/serialdeviceenumerator_p_unix.o] Error 1
make: Leaving directory `/home/kpkale/Programs/Downloaded Examples/qserialdevice-qserialdevice-new2'
make: *** [sub-src-make_default] Error 2
18:34:49: The process "/usr/bin/make" exited with code 2.
Error while building project BuildLibrary (target: Desktop)
When executing build step 'Make'

How can I proceed with any one of them...

I need to get one small application completed for I/O on serial port.

KPKALE

Oleg
21st December 2011, 13:49
Install libudev-dev package to get libudev.h.

kuzulis
21st December 2011, 15:04
2 kpkale

The version that you downloaded QSerialDevice - obsolete!
Use version 2.0: http://gitorious.org/qserialdevice/qserialdevice/archive-tarball/2.0

kpkale
22nd December 2011, 05:39
Thanks oleg and kuzulis

I will try both these things and post the results...

Added after 45 minutes:

Thanks Kuzulis

This thread further helped me... got the serial working wuth the 2.0 library.

http://developer.qt.nokia.com/forums/viewthread/12643