Image 01
profile-image

Krozac

Krozac Krozac
QSerialDevice

Qt Components by kuzulis 143 comments

I have this error while compile in linux for arm:
arm-linux-g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.7.3-arm/lib -o qserialdevice abstractserial.o abstractserialengine.o abstractserialnotifier.o nativeserialengine.o nativeserialengine_unix.o nativeserialnotifier_unix.o ttylocker.o -L/usr/local/Trolltech/QtEmbedded-4.7.3-arm/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.7.3-arm/lib -lQtNetwork -lQtCore -lpthread
/usr/local/arm/bin/../arm-none-linux-gnueabi//sys-root/usr/lib/crt1.o: In function `_start':
init.c:(.text+0x30): undefined reference to `main'
collect2: ld returned 1 exit status

I have clean all sources from win reference but when I compile it stop here, any suggestions?

Best regards - Sep 20 2011
QSerialDevice

Qt Components by kuzulis 143 comments

Hi Kuzulis,
I have try to build guiapp in windows + qtsdk 1.1 mingw I think there are the same errors:

mingw32-make: Leaving directory `C:/Users/Luca/Desktop/qserialdevice-linux/test/guiapp-build-desktop'
./debug\serialdeviceenumerator.o: In function `SerialDeviceEnumerator':
qserialdevice\test\guiapp-build-desktop/../../src/qserialdeviceenumerator/serialdeviceenumerator.cpp:268: undefined reference to `SerialDeviceEnumeratorPrivate::SerialDeviceEnumeratorPrivate()'
qserialdevice\test\guiapp-build-desktop/../../src/qserialdeviceenumerator/serialdeviceenumerator.cpp:268: undefined reference to `SerialDeviceEnumeratorPrivate::SerialDeviceEnumeratorPrivate()'
./debug\serialdeviceenumerator.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdeviceenumerator/serialdeviceenumerator.cpp:294: undefined reference to `SerialDeviceEnumeratorPrivate::setEnabled(bool)'
./debug\serialdeviceenumerator.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdeviceenumerator/serialdeviceenumerator.cpp:304: undefined reference to `SerialDeviceEnumeratorPrivate::isEnabled() const'
./debug\serialdeviceenumerator.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdeviceenumerator/serialdeviceenumerator.cpp:518: undefined reference to `SerialDeviceEnumeratorPrivate::nativeIsBusy() const'
./debug\serialdeviceenumerator.o:qserialdevice\test\guiapp-build-desktop/debug/moc_serialdeviceenumerator.cpp:77: undefined reference to `SerialDeviceEnumeratorPrivate::_q_processWatcher()'
./debug\nativeserialengine.o: In function `NativeSerialEngine':
qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:41: undefined reference to `NativeSerialEnginePrivate::NativeSerialEnginePrivate()'
qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:41: undefined reference to `NativeSerialEnginePrivate::NativeSerialEnginePrivate()'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:53: undefined reference to `NativeSerialEnginePrivate::nativeOpen(QFlags<QIODevice::OpenModeFlag>)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:55: undefined reference to `NativeSerialEnginePrivate::nativeClose()'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:62: undefined reference to `NativeSerialEnginePrivate::nativeClose()'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:68: undefined reference to `NativeSerialEnginePrivate::nativeSetBaudRate(int, QFlags<AbstractSerial::BaudRateDirectionFlag>)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:74: undefined reference to `NativeSerialEnginePrivate::nativeSetDataBits(AbstractSerial::DataBits)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:80: undefined reference to `NativeSerialEnginePrivate::nativeSetParity(AbstractSerial::Parity)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:86: undefined reference to `NativeSerialEnginePrivate::nativeSetStopBits(AbstractSerial::StopBits)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:92: undefined reference to `NativeSerialEnginePrivate::nativeSetFlowControl(AbstractSerial::Flow)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:98: undefined reference to `NativeSerialEnginePrivate::nativeSetCharReadTimeout(int)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:104: undefined reference to `NativeSerialEnginePrivate::nativeCharReadTimeout() const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:110: undefined reference to `NativeSerialEnginePrivate::nativeSetTotalReadConstantTimeout(int)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:116: undefined reference to `NativeSerialEnginePrivate::nativeTotalReadConstantTimeout() const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:122: undefined reference to `NativeSerialEnginePrivate::nativeSetDtr(bool) const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:128: undefined reference to `NativeSerialEnginePrivate::nativeSetRts(bool) const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:134: undefined reference to `NativeSerialEnginePrivate::nativeLineStatus() const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:140: undefined reference to `NativeSerialEnginePrivate::nativeSendBreak(int) const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:146: undefined reference to `NativeSerialEnginePrivate::nativeSetBreak(bool) const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:152: undefined reference to `NativeSerialEnginePrivate::nativeFlush() const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:158: undefined reference to `NativeSerialEnginePrivate::nativeReset() const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:164: undefined reference to `NativeSerialEnginePrivate::nativeBytesAvailable() const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:173: undefined reference to `NativeSerialEnginePrivate::nativeWrite(char const*, long long)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:192: undefined reference to `NativeSerialEnginePrivate::nativeRead(char*, long long)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:209: undefined reference to `NativeSerialEnginePrivate::nativeSelect(int, bool, bool, bool*, bool*)'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:317: undefined reference to `NativeSerialEnginePrivate::nativeCurrentQueue(NativeSerialEngine::ioQueue) const'
./debug\nativeserialengine.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/nativeserialengine.cpp:324: undefined reference to `NativeSerialEnginePrivate::nativeCurrentQueue(NativeSerialEngine::ioQueue) const'
./debug\abstractserialnotifier.o:qserialdevice\test\guiapp-build-desktop/../../src/qserialdevice/abstractserialnotifier.cpp:7: undefined reference to `NativeSerialNotifier::NativeSerialNotifier(NativeSerialEngine*)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug\guiapp.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project guiapp (target: Desktop)
When executing build step 'Make'

It is missing some code from the *win* *mac* files that I delete all references and files?

Best regards - Apr 25 2011
QSerialDevice

Qt Components by kuzulis 143 comments

Hi Kuzulis,
Thank you very much.
I have to remove all lines with *win* from .pri and .pro AND delete all files named *win*.
Now I can compile test1.pro but when I try to compile guiapp2.pro I have this error:

arm-linux-g++ -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/QtEmbedded-4.7.2-arm/lib -o guiapp2 infowidget.o main.o mainwidget.o optionswidget.o tracewidget.o serialdeviceenumerator.o abstractserial.o moc_infowidget.o moc_mainwidget.o moc_optionswidget.o moc_tracewidget.o moc_abstractserial.o -L/usr/local/Trolltech/QtEmbedded-4.7.2-arm/lib -lQtGui -L/usr/local/Trolltech/QtEmbedded-4.7.2-arm/lib -lQtNetwork -lQtCore -lpthread
moc_abstractserial.o: In function `AbstractSerial::metaObject() const':
moc_abstractserial.cpp:(.text+0x0): multiple definition of `AbstractSerial::metaObject() const'
abstractserial.o:abstractserial.cpp:(.text+0x178): first defined here
moc_abstractserial.o: In function `AbstractSerial::ringChanged(bool)':
moc_abstractserial.cpp:(.text+0x1c): multiple definition of `AbstractSerial::ringChanged(bool)'
abstractserial.o:abstractserial.cpp:(.text+0x194): first defined here
moc_abstractserial.o: In function `AbstractSerial::dsrChanged(bool)':
moc_abstractserial.cpp:(.text+0x58): multiple definition of `AbstractSerial::dsrChanged(bool)'
abstractserial.o:abstractserial.cpp:(.text+0x1d0): first defined here
moc_abstractserial.o: In function `AbstractSerial::ctsChanged(bool)':
moc_abstractserial.cpp:(.text+0x94): multiple definition of `AbstractSerial::ctsChanged(bool)'
abstractserial.o:abstractserial.cpp:(.text+0x20c): first defined here
moc_abstractserial.o: In function `AbstractSerial::exception()':
moc_abstractserial.cpp:(.text+0xd0): multiple definition of `AbstractSerial::exception()'
abstractserial.o:abstractserial.cpp:(.text+0x2f4): first defined here
moc_abstractserial.o: In function `AbstractSerial::signalStatus(QString const&, QDateTime)':
moc_abstractserial.cpp:(.text+0xf0): multiple definition of `AbstractSerial::signalStatus(QString const&, QDateTime)'
abstractserial.o:abstractserial.cpp:(.text+0x32c): first defined here
moc_abstractserial.o: In function `AbstractSerial::qt_metacall(QMetaObject::Call, int, void**)':
moc_abstractserial.cpp:(.text+0x128): multiple definition of `AbstractSerial::qt_metacall(QMetaObject::Call, int, void**)'
abstractserial.o:abstractserial.cpp:(.text+0x364): first defined here
moc_abstractserial.o: In function `AbstractSerial::qt_metacast(char const*)':
moc_abstractserial.cpp:(.text+0x21c): multiple definition of `AbstractSerial::qt_metacast(char const*)'
abstractserial.o:abstractserial.cpp:(.text+0x458): first defined here
moc_abstractserial.o:(.rodata+0x0): multiple definition of `AbstractSerial::staticMetaObject'
abstractserial.o:(.rodata+0x0): first defined here
moc_abstractserial.o:(.rodata+0x98): multiple definition of `vtable for AbstractSerial'
abstractserial.o:(.rodata+0x148): first defined here
moc_abstractserial.o:(.rodata+0x110): multiple definition of `typeinfo name for AbstractSerial'
abstractserial.o:(.rodata+0x1e4): first defined here
moc_abstractserial.o:(.rodata+0x124): multiple definition of `typeinfo for AbstractSerial'
abstractserial.o:(.rodata+0x1f8): first defined here
serialdeviceenumerator.o: In function `SerialDeviceEnumerator::qt_metacall(QMetaObject::Call, int, void**)':
serialdeviceenumerator.cpp:(.text+0xa4): undefined reference to `SerialDeviceEnumeratorPrivate::_q_processWatcher()'
serialdeviceenumerator.o: In function `SerialDeviceEnumerator::isBusy() const':
serialdeviceenumerator.cpp:(.text+0xf8): undefined reference to `SerialDeviceEnumeratorPrivate::nativeIsBusy() const'
serialdeviceenumerator.o: In function `SerialDeviceEnumerator::isEnabled() const':
serialdeviceenumerator.cpp:(.text+0x10c): undefined reference to `SerialDeviceEnumeratorPrivate::isEnabled() const'
serialdeviceenumerator.o: In function `SerialDeviceEnumerator::setEnabled(bool)':
serialdeviceenumerator.cpp:(.text+0x120): undefined reference to `SerialDeviceEnumeratorPrivate::setEnabled(bool)'
serialdeviceenumerator.o: In function `SerialDeviceEnumerator::SerialDeviceEnumerator(QObject*)':
serialdeviceenumerator.cpp:(.text+0x25c): undefined reference to `SerialDeviceEnumeratorPrivate::SerialDeviceEnumeratorPrivate()'
serialdeviceenumerator.o: In function `SerialDeviceEnumerator::SerialDeviceEnumerator(QObject*)':
serialdeviceenumerator.cpp:(.text+0x2bc): undefined reference to `SerialDeviceEnumeratorPrivate::SerialDeviceEnumeratorPrivate()'
abstractserial.o: In function `AbstractSerial::setDeviceName(QString const&)':
abstractserial.cpp:(.text+0x520): undefined reference to `AbstractSerialEngine::setDeviceName(QString const&)'
abstractserial.o: In function `AbstractSerialPrivate::initSerialLayer()':
abstractserial.cpp:(.text+0x540): undefined reference to `AbstractSerialEngine::createSerialEngine(QObject*)'
abstractserial.cpp:(.text+0x558): undefined reference to `AbstractSerialEngine::setReceiver(AbstractSerialEngineReceiver*)'
abstractserial.o: In function `AbstractSerial::baudRate(QFlags<AbstractSerial::BaudRateDirectionFlag>) const':
abstractserial.cpp:(.text+0x2cf8): undefined reference to `AbstractSerialEngine::baudRate(QFlags<AbstractSerial::BaudRateDirectionFlag>) const'
abstractserial.o: In function `AbstractSerial::parity() const':
abstractserial.cpp:(.text+0x2e68): undefined reference to `AbstractSerialEngine::parity() const'
abstractserial.o: In function `AbstractSerial::stopBits() const':
abstractserial.cpp:(.text+0x2f54): undefined reference to `AbstractSerialEngine::stopBits() const'
abstractserial.o: In function `AbstractSerial::dataBits() const':
abstractserial.cpp:(.text+0x3040): undefined reference to `AbstractSerialEngine::dataBits() const'
abstractserial.o: In function `AbstractSerial::flowControl() const':
abstractserial.cpp:(.text+0x312c): undefined reference to `AbstractSerialEngine::flow() const'
abstractserial.o: In function `AbstractSerial::deviceName() const':
abstractserial.cpp:(.text+0x3c7c): undefined reference to `AbstractSerialEngine::deviceName() const'
collect2: ld returned 1 exit status
make: *** [guiapp2] Errore 1

Any suggestions?

Best regards,

Krozac - Apr 20 2011
QSerialDevice

Qt Components by kuzulis 143 comments

Hi kuzulis,
thank you very much for share this lib ;)
I have a problem when I try to compile under linux with arm-gcc:

arm-linux-g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Trolltech/QtEmbedded-4.7.2-arm/mkspecs/qws/linux-arm-g++ -I. -I/usr/local/Trolltech/QtEmbedded-4.7.2-arm/$
In file included from ./windef.h:253,
from ./ddk/ntddk.h:44,
from ./ddk/ntddser.h:34,
from nativeserialengine_win.cpp:27:
./winnt.h:2377:2: error: #error "undefined processor type"
In file included from /usr/local/Trolltech/QtEmbedded-4.7.2-arm/include/QtCore/qbytearray.h:48,
from /usr/local/Trolltech/QtEmbedded-4.7.2-arm/include/QtCore/qstring.h:46,
from /usr/local/Trolltech/QtEmbedded-4.7.2-arm/include/QtCore/qobject.h:48,
from /usr/local/Trolltech/QtEmbedded-4.7.2-arm/include/QtCore/QObject:1,
from abstractserialengine.h:27,
from nativeserialengine.h:27,
from nativeserialengine_p.h:4,
from nativeserialengine_win.cpp:24:
./string.h:36: warning: '__cdecl__' attribute directive ignored
./string.h:37: warning: '__cdecl__' attribute directive ignored
./string.h:38: warning: '__cdecl__' attribute directive ignored
./string.h:39: warning: '__cdecl__' attribute directive ignored
./string.h:40: warning: '__cdecl__' attribute directive ignored
./string.h:41: warning: '__cdecl__' attribute directive ignored
./string.h:42: warning: '__cdecl__' attribute directive ignored
./string.h:43: warning: '__cdecl__' attribute directive ignored

I copied the dir include from mingw to compile until here.
Have any suggestion to compile it?

I don't need the windows support.รน
It is available a qserialdevice with only support for linux?

Best regards,

Krozac - Apr 20 2011
QSerialDevice

Qt Components
by kuzulis

7.9
Sep 20 2011
QSerialDevice

Qt Components
by kuzulis

7.9
9   Apr 25 2011