compile problems comedirecord

261 views
Skip to first unread message

Michael

unread,
Aug 11, 2009, 8:34:46 AM8/11/09
to Comedi: Linux Control and Measurement Device Interface, michael....@wzw.tum.de
Dear list

I am new to this list and to comedi. Since I would like to integrate
an
USBDUXfast into my experiments, I tried to compile comedirecord (v
0.99b).
Compilation stops with a lot of error messages, which I am unable to
resolve.
These messages are included below

Compilation was carried out on Ubuntu 9.04 with the qt3/qt4 libraries
installed
including development files (libqt4-dev, libqt3-mt-dev). QWT and FFTW3
are also
installed (libqwt5-qt3, libqwt5-qt3-dev, libqwt5-qt4, libqwt5-qt4-
dev,
libfftw3-3, libfftw3-3-dev).

Comedi (version: 0.7.76) works fine as tested with ktimetrace and the
USBDUXfast.

I would be very grateful to receive hints how to resolve this problem
and how
to get a comedirecord executable.

Cheers, Michael

==================================================================================

mjg@aradus:~/Quellen/comedirecord-0.99b$ make
g++ -c -pipe -g -Wall -W -O0 -D_REENTRANT -DQT_THREAD_SUPPORT -
DQT_SHARED -DQT_TABLET_SUPPORT -DQT_NO_DEBUG -I/usr/share/qt3/mkspecs/
default -I. -I/usr/include/qt3 -o comedirecord.o comedirecord.cpp
comedirecord.cpp:11:24: Fehler: Q3HBoxLayout: No such file or
directory
comedirecord.cpp:12:19: Fehler: Q3Frame: No such file or directory
comedirecord.cpp:13:24: Fehler: Q3VBoxLayout: No such file or
directory
comedirecord.cpp:14:24: Fehler: QButtonGroup: No such file or
directory
comedirecord.cpp:15:21: Fehler: QGroupBox: No such file or directory
comedirecord.cpp:25:25: Fehler: q3filedialog.h: No such file or
directory
comedirecord.cpp:27:24: Fehler: q3hgroupbox.h: No such file or
directory
comedirecord.cpp:28:25: Fehler: q3popupmenu.h: No such file or
directory
In Datei, eingefügt von comedirecord.cpp:30:
comediscope.h:2:23: Fehler: QPaintEvent: No such file or directory
comediscope.h:3:23: Fehler: QTimerEvent: No such file or directory
comediscope.h:15:24: Fehler: q3groupbox.h: No such file or directory
comediscope.h:16:27: Fehler: q3buttongroup.h: No such file or
directory
In Datei, eingefügt von comediscope.h:23,
von comedirecord.cpp:30:
comedirecord.h:2:23: Fehler: Q3PopupMenu: No such file or directory
comedirecord.h:15:26: Fehler: q3mainwindow.h: No such file or
directory
In Datei, eingefügt von comedirecord.h:23,
von comediscope.h:23,
von comedirecord.cpp:30:
fftscope.h:19:23: Fehler: QMainWindow: No such file or directory
In Datei, eingefügt von comedirecord.h:26,
von comediscope.h:23,
von comedirecord.cpp:30:
gain.h:8:22: Fehler: QBoxLayout: No such file or directory
In file included from comedirecord.h:23,
from comediscope.h:23,
from comedirecord.cpp:30:
fftscope.h:28: Fehler: expected class-name before »{« token
In file included from comedirecord.h:26,
from comediscope.h:23,
from comedirecord.cpp:30:
gain.h:24: Fehler: ISO-C++ verbietet Deklaration von »Q3PopupMenu«
ohne Typ
gain.h:24: Fehler: expected »;« before »*« token
In file included from comediscope.h:23,
from comedirecord.cpp:30:
comedirecord.h:198: Fehler: ISO-C++ verbietet Deklaration von
»QGroupBox« ohne Typ
comedirecord.h:198: Fehler: expected »;« before »*« token
/usr/include/qt3/qwidget.h: In constructor »ComediRecord::ComediRecord
(QWidget*, const char*, int)«:
/usr/include/qt3/qwidget.h:639: Fehler: »void QWidget::setLayout
(QLayout*)« ist privat
comedirecord.cpp:44: Fehler: in diesem Zusammenhang
/usr/include/qt3/qwidget.h:639: Fehler: »void QWidget::setLayout
(QLayout*)« ist privat
comedirecord.cpp:44: Fehler: in diesem Zusammenhang
comedirecord.cpp:49: Fehler: »QGroupBox« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:49: Fehler: »controlBox« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:49: Fehler: expected type-specifier before
»QGroupBox«
comedirecord.cpp:49: Fehler: expected `;' before »QGroupBox«
comedirecord.cpp:57: Fehler: »scopeGroup« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:57: Fehler: expected type-specifier before
»QGroupBox«
comedirecord.cpp:57: Fehler: expected `;' before »QGroupBox«
comedirecord.cpp:63: Fehler: »channelgrp« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:63: Fehler: expected type-specifier before
»QGroupBox«
comedirecord.cpp:63: Fehler: expected `;' before »QGroupBox«
comedirecord.cpp:76: Fehler: expected type-specifier before
»QGroupBox«
comedirecord.cpp:76: Fehler: expected `;' before »QGroupBox«
comedirecord.cpp:82: Fehler: keine passende Funktion für Aufruf von
»QCheckBox::QCheckBox()«
/usr/include/qt3/qcheckbox.h:81: Anmerkung: Kandidaten sind:
QCheckBox::QCheckBox(const QCheckBox&)
/usr/include/qt3/qcheckbox.h:59: Anmerkung:
QCheckBox::QCheckBox(const QString&, QWidget*, const char*)
/usr/include/qt3/qcheckbox.h:58: Anmerkung:
QCheckBox::QCheckBox(QWidget*, const char*)
comedirecord.cpp:103: Fehler: »Q3Frame« wurde nicht deklariert
comedirecord.cpp:123: Fehler: »notchGroupBox« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:123: Fehler: expected type-specifier before
»QGroupBox«
comedirecord.cpp:123: Fehler: expected `;' before »QGroupBox«
comedirecord.cpp:126: Fehler: keine passende Funktion für Aufruf von
»QCheckBox::QCheckBox(QString)«
/usr/include/qt3/qcheckbox.h:81: Anmerkung: Kandidaten sind:
QCheckBox::QCheckBox(const QCheckBox&)
/usr/include/qt3/qcheckbox.h:59: Anmerkung:
QCheckBox::QCheckBox(const QString&, QWidget*, const char*)
/usr/include/qt3/qcheckbox.h:58: Anmerkung:
QCheckBox::QCheckBox(QWidget*, const char*)
comedirecord.cpp:142: Fehler: »Q3Frame« wurde nicht deklariert
comedirecord.cpp:150: Fehler: »recGroupBox« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:150: Fehler: expected type-specifier before
»QGroupBox«
comedirecord.cpp:150: Fehler: expected `;' before »QGroupBox«
comedirecord.cpp:155: Fehler: keine passende Funktion für Aufruf von
»QPushButton::QPushButton(const char [10])«
/usr/include/qt3/qpushbutton.h:141: Anmerkung: Kandidaten sind:
QPushButton::QPushButton(const QPushButton&)
/usr/include/qt3/qpushbutton.h:70: Anmerkung:
QPushButton::QPushButton(const QIconSet&, const QString&, QWidget*,
const char*)
/usr/include/qt3/qpushbutton.h:68: Anmerkung:
QPushButton::QPushButton(const QString&, QWidget*, const char*)
/usr/include/qt3/qpushbutton.h:67: Anmerkung:
QPushButton::QPushButton(QWidget*, const char*)
comedirecord.cpp:168: Fehler: keine passende Funktion für Aufruf von
»QCheckBox::QCheckBox(const char [5])«
/usr/include/qt3/qcheckbox.h:81: Anmerkung: Kandidaten sind:
QCheckBox::QCheckBox(const QCheckBox&)
/usr/include/qt3/qcheckbox.h:59: Anmerkung:
QCheckBox::QCheckBox(const QString&, QWidget*, const char*)
/usr/include/qt3/qcheckbox.h:58: Anmerkung:
QCheckBox::QCheckBox(QWidget*, const char*)
/usr/include/qt3/qbutton.h:216: Fehler: »void QButton::setToggleButton
(bool)« ist geschützt
comedirecord.cpp:170: Fehler: in diesem Zusammenhang
/usr/include/qt3/qbutton.h:221: Fehler: »void QButton::setOn(bool)«
ist geschützt
comedirecord.cpp:171: Fehler: in diesem Zusammenhang
comedirecord.cpp:180: Fehler: keine passende Funktion für Aufruf von
»QCheckBox::QCheckBox(const char [9])«
/usr/include/qt3/qcheckbox.h:81: Anmerkung: Kandidaten sind:
QCheckBox::QCheckBox(const QCheckBox&)
/usr/include/qt3/qcheckbox.h:59: Anmerkung:
QCheckBox::QCheckBox(const QString&, QWidget*, const char*)
/usr/include/qt3/qcheckbox.h:58: Anmerkung:
QCheckBox::QCheckBox(QWidget*, const char*)
comedirecord.cpp:188: Fehler: »tbgrp« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:188: Fehler: expected type-specifier before
»QGroupBox«
comedirecord.cpp:188: Fehler: expected `;' before »QGroupBox«
comedirecord.cpp:200: Fehler: keine passende Funktion für Aufruf von
»QPushButton::QPushButton(const char [2])«
/usr/include/qt3/qpushbutton.h:141: Anmerkung: Kandidaten sind:
QPushButton::QPushButton(const QPushButton&)
/usr/include/qt3/qpushbutton.h:70: Anmerkung:
QPushButton::QPushButton(const QIconSet&, const QString&, QWidget*,
const char*)
/usr/include/qt3/qpushbutton.h:68: Anmerkung:
QPushButton::QPushButton(const QString&, QWidget*, const char*)
/usr/include/qt3/qpushbutton.h:67: Anmerkung:
QPushButton::QPushButton(QWidget*, const char*)
comedirecord.cpp:214: Fehler: keine passende Funktion für Aufruf von
»QPushButton::QPushButton(const char [2])«
/usr/include/qt3/qpushbutton.h:141: Anmerkung: Kandidaten sind:
QPushButton::QPushButton(const QPushButton&)
/usr/include/qt3/qpushbutton.h:70: Anmerkung:
QPushButton::QPushButton(const QIconSet&, const QString&, QWidget*,
const char*)
/usr/include/qt3/qpushbutton.h:68: Anmerkung:
QPushButton::QPushButton(const QString&, QWidget*, const char*)
/usr/include/qt3/qpushbutton.h:67: Anmerkung:
QPushButton::QPushButton(QWidget*, const char*)
comedirecord.cpp:238: Fehler: »Q3Frame« wurde nicht deklariert
comedirecord.cpp: In member function »void ComediRecord::enterFileName
()«:
comedirecord.cpp:280: Fehler: »Q3FileDialog« wurde in diesem
Gültigkeitsbereich nicht definiert
comedirecord.cpp:280: Fehler: »fd« wurde in diesem Gültigkeitsbereich
nicht definiert
comedirecord.cpp:280: Fehler: expected type-specifier before
»Q3FileDialog«
comedirecord.cpp:280: Fehler: expected `;' before »Q3FileDialog«
comedirecord.cpp:281: Fehler: »Q3FileDialog« is not a class or
namespace
comedirecord.cpp:285: Fehler: unvollständiger Typ »QDialog« in
geschachtelter Namensangabe verwendet
comedirecord.cpp: In member function »void ComediRecord::showFFT()«:
comedirecord.cpp:305: Fehler: »class FFTScope« hat kein Element namens
»show«
comedirecord.cpp: In member function »void ComediRecord::fftDDEvent
(int)«:
comedirecord.cpp:314: Fehler: »class FFTScope« hat kein Element namens
»setCaption«
comedirecord.cpp: In member function »void ComediRecord::recstartstop
(int)«:
comedirecord.cpp:321: Fehler: »class QCheckBox« hat kein Element
namens »checkState«
comedirecord.cpp:321: Fehler: »Checked« ist kein Element von »Qt«
make: *** [comedirecord.o] Fehler 1

--------------------------------------------
Dr. Michael Gebhardt
Lehrstuhl für Zoologie, Technische Universität München
Hochfeldweg 2
85350 Freising-Weihenstephan, Germany

Tel.: +49 (0)8161-71 2805
Fax: +49 (0)8161-71 2802
Email: michael....@wzw.tum.de
Web: http://www.wzw.tum.de/zoologie/index.php?id=80

Bernd Porr

unread,
Aug 11, 2009, 11:16:57 AM8/11/09
to comed...@googlegroups.com, michael....@wzw.tum.de
It's clearly including QT3 and not QT4:

-I/usr/include/qt3

Remove all qt3 development headers, install qt4-dev and then run "qmake"
and "make".

/Bernd

www: http://www.berndporr.me.uk/
http://www.linux-usb-daq.co.uk/
Mobile: +44 (0)7840 340069
Work: +44 (0)141 330 5237
University of Glasgow
Department of Electronics & Electrical Engineering
72 Oakfield Avenue (for deliveries: Rankine Building)
Glasgow, G12 8LT

Brent Baccala

unread,
Aug 11, 2009, 1:17:13 PM8/11/09
to comed...@googlegroups.com
Hi -

Does anybody have a copy of ComediClientServer?

If so, can you send me a copy, please?

Calin Culianu's site (ajvar.org) seems to be done, and judging from an
earlier email on this list, it's been down for a while.

Thanks.


-bwb

Brent Baccala
cos...@freesoft.org

Michael

unread,
Aug 12, 2009, 5:29:55 AM8/12/09
to Comedi: Linux Control and Measurement Device Interface
> It's clearly including QT3 and not QT4:
>
> -I/usr/include/qt3
>
> Remove all qt3 development headers, install qt4-dev and then run "qmake"
> and "make".

Bernd, many thanks for this advice, compilation produced an executable
after removing all qt3 development files.

comedirecord won't start up, though:

mjg@aradus:~$ comedirecord
first test returned 0
second test returned 0
comedi_command: Bad address

dmesg says:

[10730.220053] usb 1-5: new high speed USB device using ehci_hcd
and address 7
[10730.353756] usb 1-5: configuration #1 chosen from 1 choice
[10730.356494] comedi_: usbduxfast0 has been successfully
initialized.
[10730.356556] usb 1-5: firmware: requesting
usbduxfast_firmware.hex
[10730.406363] comedi0: usbduxfast: usb-device 0 is attached to
comedi.
[10730.406372] comedi0: successfully attached to usbduxfast.
[10748.418481] comedi 0: unsupported combination of channels
[11031.989253] comedi 0: unsupported combination of channels
[11237.488311] comedi 0: unsupported combination of channels

A test with ktimetrace was successful immediately after that.

Any hint how to resolve this is appreciated.

Michael

Bernd Porr

unread,
Aug 12, 2009, 5:49:00 AM8/12/09
to comed...@googlegroups.com
Hi!

Comedirecord is not really desiged for USBDUXfast. You can hack it of
you change the number of channels to 1,2,3 or 16. I would recommend to
sample all 16 channels and then use the lowest sampling rate.

/Bernd
--
www: http://www.berndporr.me.uk/
http://www.linux-usb-daq.co.uk/
Mobile: +44 (0)7840 340069
Work: +44 (0)141 330 5237
University of Glasgow
Department of Electronics & Electrical Engineering
72 Oakfield Avenue (Rankine Building for deliveries)
Glasgow, G12 8LT

Michele Petrecca

unread,
Aug 13, 2009, 7:29:52 PM8/13/09
to comed...@googlegroups.com, cos...@freesoft.org
Hi all, :-))

I have enclosed file ComediClientServer.
In the next weeks it will be present on my site;

http://elettrolinux.com

...at the moment higly incomplete. :-(

Bye 8-)

2009/8/11 Brent Baccala <cos...@freesoft.org>
ComediClientServer-1.1.tar.gz

Brent Baccala

unread,
Aug 14, 2009, 1:02:59 AM8/14/09
to comed...@googlegroups.com

I've been thinking more about this (handling USB devices), and here's
what I'm leaning towards.

Don't do anything in the kernel. Modify comedilib as follows.

comedi_open() looks at the string passed into it. If it doesn't
contain a colon, proceed as before. If the string contains a colon,
then parse it as "DRIVERNAME:...", and attempts to dynamically load a
library called "comedi_DRIVERNAME". This library should export the
following functions:

- comedi_driver_open
- comedi_driver_close
- comedi_driver_ioctl
- comedi_driver_read
- comedi_driver_write
- comedi_driver_fileno

The comedilib now passes all of its low-level operations for this
device to the dynamic library instead of using system calls.

Some standard drivers we'd like to support:

"rpc:HOSTNAME:FILENAME" - Sun RPC service that connects to a remote
server and a remote COMEDI device

Obviously, we'll have to define the RPC protocol and write a server.
Just transport everything across 1-to-1. Some kind of authentication
will be required. Might want something similar for CORBA, too. This
will provide the functions of ComediClientServer, and in a much
cleaner manner (I hope).

"usb:" - generic USB protocol
(pick first device recognized by USB driver)

"usb:BBB.DDD" - generic USB protocol to bus BBB device DDD

"usb:id=VV.PP[.N]" - generic USB protocol to vendor VV product PP number N

For generic use (where we control the USB device firmware), a USB
protocol should be defined to transport COMEDI requests directly to
the device. Something very similar to the RPC protocol, I would
think, though able to take advantage of the multiple endpoints
available to a USB device. Maybe run the ioctl's on endpoint 0 and
put the reads and writes on two other endpoints.

For devices with USB protocols already defined, the USB driver library
would have to be programmed to handle the protocol. Alternately,
separate driver libraries with separate driver names could be used.


Obviously, mmap just wouldn't work with such a COMEDI device, and
applications should be prepared for this - they might be using a
remote device with no shared memory.

Actually, this leads to what I (currently) see as the biggest problem
with this idea - the undefined behavior of the file descriptor
returned by comedi_driver_fileno. libusb, for example, returns a LIST
of file descriptors that should be polled by the application. There's
probably a lot of code (including my own) that select() on the COMEDI
file descriptor, so the only backwards-compatible way that I see of
handling this would be fire off a thread that sits in a tight little
select() loop on the USB file descriptor list, and writes to a pipe
whenever it's ready to signal the user application, which was returned
the other end of the pipe when it called comedi_driver_fileno() via
comedi_fileno(). Yuck. I don't see any really good way of handling
this, either - libusb wants to select on a fd set, while libcomedi is
built around a single fd, so how do we integrate the two when we're
doing acquisition from a USB device?

I'm more and more convinced, however, that the answer to this last
question is not "put the driver in the kernel".

Here's hoping for your comments...

-bwb

Brent Baccala
cos...@freesoft.org

Brent Baccala

unread,
Aug 23, 2009, 2:10:24 AM8/23/09
to comed...@googlegroups.com
On Fri, 14 Aug 2009, Brent Baccala wrote:

> I've been thinking more about this (handling USB devices), and here's
> what I'm leaning towards.
>

> Don't do anything in the kernel. Modify comedilib as follows...

I didn't do it that way. I ended up using a preload library instead
to intercept the open and ioctl calls without touching comedilib.

I'm not doing USB right now, instead I'm running "remote COMEDI"
across IP. I'm using TCP for the COMEDI data stream and UDP/RPC to
transport the ioctl calls. A server program interfaces to an existing
/dev/comedi0 device (in my case comedi_test).

It's working pretty well. All the ioctl stuff seems to work fine.

The problem that I've got right now is how to handle error returns on
read(). This happens a lot on comedi; all it seems to take is a
buffer overflow. The way my normal COMEDI code is written, when I
detect an EPIPE on a read, that means more ioctl stuff needs to be
done (i.e, start a new command running) before attempting more reads.

The problem is that I need to handle this in a select() loop in the
server program. I guess what I'm thinking now is to report a read
error using an out-of-band TCP message, then ignore the comedi device
until an ioctl is done. After each ioctl, check the comedi device to
see if it is still returning errors. If so, keep ignoring it. Only
when select/read reports a non-error do we start transferring data
again to the client. Only a single error is reported for this entire
process. If the client tried to read during this time, it would
either block or get EAGAIN.

Does this make sense?

Also, are zero-byte read() returns significant on comedi devices?

Do they need to be reported too, or can they just be ignored?

Ian Abbott

unread,
Aug 24, 2009, 5:46:55 AM8/24/09
to comed...@googlegroups.com
On 14/08/09 00:29, Michele Petrecca wrote:
> Hi all, :-))
>
> I have enclosed file ComediClientServer.
> In the next weeks it will be present on my site;
>
> http://elettrolinux.com
>
> ...at the moment higly incomplete. :-(
>
> Bye 8-)

Thanks. Let us know when it's on the site so the dead link can be updated.

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-

Michele Petrecca

unread,
Sep 22, 2009, 7:50:39 AM9/22/09
to comed...@googlegroups.com
Hi all, :-)

sorry for delay, but only today I finished setting up an initial repository. Package ComediClientServer is available at this address;

http://repository.elettrolinux.com/Generic/

I want to remember that I am not a developer of ComediClientServer, therefore, who wanted to continue the development can rely on my repository. ;-))

Thanks & Bye 8-)



2009/8/24 Ian Abbott <abb...@mev.co.uk>

Ian Abbott

unread,
Sep 22, 2009, 8:40:31 AM9/22/09
to comed...@googlegroups.com
On 22/09/09 12:50, Michele Petrecca wrote:
> Hi all, :-)
>
> sorry for delay, but only today I finished setting up an initial
> repository. Package ComediClientServer is available at this address;
>
> http://repository.elettrolinux.com/Generic/
>
> I want to remember that I am not a developer of ComediClientServer,
> therefore, who wanted to continue the development can rely on my
> repository. ;-))
>
> Thanks & Bye 8-)

Thanks, Michele. I've updated the link on the applications page, but
have added an additional link to the original location in case it ever
returns!

Reply all
Reply to author
Forward
0 new messages