QSerialDevice problem to start in GUi
Hi, my problem is to use the QSerialDevice in my Gui. Functions,constructors they are need QObject "parameters" but in my class in constructor I have QWidget
Code:
#include "src/qserialdeviceenumerator/serialdeviceenumerator.h"
canteen
::canteen(QWidget *parent
) : ui(new Ui::canteen)
{
this->m_sde= new SerialDeviceEnumerator(this);
ui->setupUi(this);
}
when i build ... is ":: error: collect2: ld returned 1 exit status"
And I have a few questons
1.Is it posible to use QSerialDevice in Gui ??
2. Can anybody could help ??
Sorry for my english
Re: QSerialDevice problem to start in GUi
Please post the first error you get instead of the last one.
Re: QSerialDevice problem to start in GUi
It is something like this:
Code:
debug/canteen.o: In function `canteen':
C:\Qt\2010.05\Canteen/canteen.cpp:8: undefined reference to `SerialDeviceEnumerator::SerialDeviceEnumerator(QObject*)'
C
:\Qt\
2010.05\Canteen
/canteen.
cpp:8: undefined reference to `SerialDeviceEnumerator
::SerialDeviceEnumerator(QObject*)'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug/Canteen.exe] Error 1
mingw32-make: *** [debug] Error 2
Proces "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" zakończył się kodem wyjściowym %2.
BÅ‚Ä…d podczas budowania projektu Canteen (produkt docelowy: Desktop)
Podczas wykonywania kroku budowania "Make"
Re: QSerialDevice problem to start in GUi
Is the SerialDeviceEnumerator your class or is it part of QSerialDevice? If the latter, do you link with QSerialDevice?
Re: QSerialDevice problem to start in GUi
Yes I use , include class from QSerialDevice. I copy the src something like this
Code:
#include "src/qserialdeviceenumerator/serialdeviceenumerator.h"
#include "src/qserialdevice/abstractserial.h"
Re: QSerialDevice problem to start in GUi
You are not copying the source, you only included header files.
Re: QSerialDevice problem to start in GUi
The src is in the project file :) i copied them from the QSerialDevice project
Re: QSerialDevice problem to start in GUi
Does your project files reference all the cpp files? Because judging by the error they are not being compiled and linked with your project.
Re: QSerialDevice problem to start in GUi
Yes it is problem with including files. Because when I want run the application from BuldingExamples and chose in debug enumerator it ist working but when I want open just enumerator.pro and want run this I get something like
Code:
c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lqserialdeviced
collect2: ld returned 1 exit status
mingw32-make[1]: *** [debug/enumeratord.exe] Error 1
mingw32-make: *** [debug] Error 2
when i comment the line with -lqserialdevice in enumerator.pro I get the same error like in my project
Re: QSerialDevice problem to start in GUi
Do you have the serial device library built?