Results 1 to 10 of 10

Thread: QSerialDevice problem to start in GUi

  1. #1
    Join Date
    Dec 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded

    Default 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

    Qt Code:
    1. #include "src/qserialdeviceenumerator/serialdeviceenumerator.h"
    2.  
    3. canteen::canteen(QWidget *parent) :
    4. QWidget(parent),
    5. ui(new Ui::canteen)
    6. {
    7. this->m_sde= new SerialDeviceEnumerator(this);
    8.  
    9. ui->setupUi(this);
    10.  
    11. }
    To copy to clipboard, switch view to plain text mode 
    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSerialDevice problem to start in GUi

    Please post the first error you get instead of the last one.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded

    Default Re: QSerialDevice problem to start in GUi

    It is something like this:
    Qt Code:
    1. debug/canteen.o: In function `canteen':
    2.  
    3. C:\Qt\2010.05\Canteen/canteen.cpp:8: undefined reference to `SerialDeviceEnumerator::SerialDeviceEnumerator(QObject*)'
    4.  
    5. C:\Qt\2010.05\Canteen/canteen.cpp:8: undefined reference to `SerialDeviceEnumerator::SerialDeviceEnumerator(QObject*)'
    6.  
    7. collect2: ld returned 1 exit status
    8.  
    9. mingw32-make[1]: *** [debug/Canteen.exe] Error 1
    10.  
    11. mingw32-make: *** [debug] Error 2
    12.  
    13. Proces "C:/Qt/2010.05/mingw/bin/mingw32-make.exe" zakończył się kodem wyjściowym %2.
    14. BÅ‚Ä…d podczas budowania projektu Canteen (produkt docelowy: Desktop)
    15. Podczas wykonywania kroku budowania "Make"
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Dec 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded

    Default Re: QSerialDevice problem to start in GUi

    Yes I use , include class from QSerialDevice. I copy the src something like this
    Qt Code:
    1. #include "src/qserialdeviceenumerator/serialdeviceenumerator.h"
    2. #include "src/qserialdevice/abstractserial.h"
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSerialDevice problem to start in GUi

    You are not copying the source, you only included header files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Dec 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded

    Default Re: QSerialDevice problem to start in GUi

    The src is in the project file i copied them from the QSerialDevice project

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default 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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Dec 2010
    Posts
    14
    Qt products
    Qt4 Qt/Embedded

    Default 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
    Qt Code:
    1. c:/qt/2010.05/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lqserialdeviced
    2.  
    3. collect2: ld returned 1 exit status
    4.  
    5. mingw32-make[1]: *** [debug/enumeratord.exe] Error 1
    6.  
    7. mingw32-make: *** [debug] Error 2
    To copy to clipboard, switch view to plain text mode 

    when i comment the line with -lqserialdevice in enumerator.pro I get the same error like in my project

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QSerialDevice problem to start in GUi

    Do you have the serial device library built?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QProcess Problem: Program doesnt start
    By musaulker in forum Newbie
    Replies: 5
    Last Post: 1st May 2020, 00:07
  2. QProcess problem to start executable
    By cydside in forum Qt Programming
    Replies: 3
    Last Post: 17th June 2010, 19:48
  3. QSerialDevice Problem
    By waynew in forum Qt Programming
    Replies: 8
    Last Post: 21st January 2010, 15:31
  4. QSerialDevice
    By clinisbut in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2009, 14:30
  5. The program start slowly with repaint problem
    By SABROG in forum Qt Programming
    Replies: 10
    Last Post: 21st May 2009, 16:50

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.