Results 1 to 20 of 33

Thread: Protocol Implementation. ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Hi wysota thank you have helped me so much in trying to get the qextserialport installed. But i still get the errors. I did exactly what you said i took a fresh copy of qextserialport-1.2win-alpha package unzipped it in C:\ drive . Opened Qt command promt cd to the qextserialport-1.2win-alpha folder and did qmake and nmake. The errors are shown in Qt cmd promt. Pls check the error.zip i have attached the snap shot of the error in the cmd promt.

    Thank You so much.
    wysota
    Attached Files Attached Files

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

    Default Re: Protocol Implementation. ?

    Use the stable release of QExtSerialPort, not the alpha one.

  3. #3
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Hi wysota i did every thing possible . I tried all the version's . I unzipped them to the C:\ and did qmake and nmake. And tried to run the example program but still i get the same error when i try to build the qespta example.
    [/CODE]
    1>.\MessageWindow.cpp(93) : error C2061: syntax error : identifier '{ctor}'
    1>.\MessageWindow.cpp(121) : error C2061: syntax error : identifier '{ctor}'
    [/CODE]

    Hey i have to some how make this work my whole project is dependent on serial communication. . Pls help me out.

    Thank You wysota

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

    Default Re: Protocol Implementation. ?

    What is the contents of those lines mentioned above?

  5. The following user says thank you to wysota for this useful post:

    dheeraj (30th April 2008)

  6. #5
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Hi wysota
    The first error takes me to this part of the code.
    Qt Code:
    1. void MessageWindow::customEvent(QEvent* event)
    2. {
    3. if (static_cast<MessageWindow::EventType>(event->type()) == MessageWindow::MessageEvent)
    4.  
    5. msgTextEdit.append(dynamic_cast<MessageEvent::MessageEvent* >(event)->msg); // '{ctor}' Error takes me to this line
    6. }
    To copy to clipboard, switch view to plain text mode 

    the second error takes me to this line.
    Qt Code:
    1. QCoreApplication::postEvent(this, new MessageEvent::MessageEvent(qmsg));
    To copy to clipboard, switch view to plain text mode 

  7. #6
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 10 Times in 10 Posts

    Default Re: Protocol Implementation. ?

    so take it in comments as I have written avbove

  8. #7
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    hey mazurekwrc i tried what you told but i get a error saying
    Qt Code:
    1. 1>LINK : fatal error LNK1181: cannot open input file 'qextserialport.lib'
    To copy to clipboard, switch view to plain text mode 
    So i added the path of the folder where qextserialport is "C:\qextserialport-1.1\qextserialport"
    there is no qextserialport.lib file though.Now when i build the program again i get a new error
    Qt Code:
    1. >LINK : fatal error LNK1181: cannot open input file 'C:\qextserialport-1.1\qextserialport.obj'
    To copy to clipboard, switch view to plain text mode 

    even get a warning
    Qt Code:
    1. 1>.\MessageWindow.cpp(90) : warning C4100: 'event' : unreferenced formal parameter
    To copy to clipboard, switch view to plain text mode 

    Hey i don't find any qextserialport.lib file any where in the qextserialport folder.

  9. #8
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 10 Times in 10 Posts

    Default Re: Protocol Implementation. ?

    add
    CONFIG += staticlib
    in qexterialport.pro file, then run qmake, nmake, go to example and run do the same

  10. The following user says thank you to mazurekwrc for this useful post:

    dheeraj (30th April 2008)

  11. #9
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Hey mazurekwrc Thank you. finally after couple of weeks of breaking head got the output for the example. The GUI was displayed once the example was complied. I need to check if it works fine to send a message from one computer to another.
    And i have a doubt what does the line
    Qt Code:
    1. " CONFIG += staticlib"
    To copy to clipboard, switch view to plain text mode 
    in qexterialport.pro file actually do all the linker errors were removed. ?? Hey and do i need to qmake and nmake all the qexterialport programs in order to work. I am using Qt 4.3.3 integrated with VS2005.net. cause i don't do qmake and nmake for all the other programs which i have been doing all these dazz.

  12. #10
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 10 Times in 10 Posts

    Default Re: Protocol Implementation. ?

    here you got about config += staticlib
    http://doc.trolltech.com/4.3/qmake-c...ding-a-library

    you asked also about qmake, it's used to create a platform-specific makefile from the project file, so if we changed .pro file we need to use it, and at the end we use nmake to build program

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

    Default Re: Protocol Implementation. ?

    Quote Originally Posted by dheeraj View Post
    Hi wysota
    The first error takes me to this part of the code.
    Qt Code:
    1. void MessageWindow::customEvent(QEvent* event)
    2. {
    3. if (static_cast<MessageWindow::EventType>(event->type()) == MessageWindow::MessageEvent)
    4.  
    5. msgTextEdit.append(dynamic_cast<MessageEvent::MessageEvent* >(event)->msg); // '{ctor}' Error takes me to this line
    6. }
    To copy to clipboard, switch view to plain text mode 

    the second error takes me to this line.
    Qt Code:
    1. QCoreApplication::postEvent(this, new MessageEvent::MessageEvent(qmsg));
    To copy to clipboard, switch view to plain text mode 
    The problem seems to be the dynamic_cast. Maybe your compiler has support for it turned off or you compiled Qt without RTTI support.

  14. #12
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Hi wysota i think the problem is solved finally. I am able to run the qextserialport examples but with a few warnings. I even tested one example program on RS232 cable connected to two computer and it is working. mazurekwrc asked me to add " CONFIG += staticlib" to .pro file. I did it and finally worked. But i had to comment these two lines
    Qt Code:
    1. msgTextEdit.append(dynamic_cast<MessageEvent::MessageEvent* >(event)->msg);
    2.  
    3. QCoreApplication::postEvent(this, new MessageEvent::MessageEvent(qmsg));
    To copy to clipboard, switch view to plain text mode 
    only then it works . Hey do you have any extra serial communication example. So that i can learn how to send a Frame in a format like i asked in the first post.

    Thank You So much wysota

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

    Default Re: Protocol Implementation. ?

    QExtSerialPort gives you access to the serial communication through the QIODevice API, so I suggest you start by taking a look at it.

  16. #14
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Hi wysota i was able to run all the example programs. I started a new QtApplication Project i wanted to send a string of numbers through serial port on click of a OK button on the GUI form. But i get two linker errors i tried so much but cud't clear the error's pls help me with tthis problem. These are the error's
    Qt Code:
    1. select_spacecraft.obj : error LNK2019: unresolved external symbol "public: __thiscall QextSerialPort::QextSerialPort(class QString const &,enum QextSerialBase::QueryMode)" (??0QextSerialPort@@QAE@ABVQString@@W4QueryMode@QextSerialBase@@@Z) referenced in function "public: __thiscall select_spacecraft::select_spacecraft(class QWidget *)" (??0select_spacecraft@@QAE@PAVQWidget@@@Z)
    2. F:\lpsu_gui 8 RS232\Debug\lpsu_gui.exe : fatal error LNK1120: 1 unresolved externals
    3. Build log was saved at "file://f:\lpsu_gui 8 RS232\lpsu_gui\Debug\BuildLog.htm"
    To copy to clipboard, switch view to plain text mode 

    I have attached the .h and .cpp files also.
    Attached Files Attached Files

  17. #15
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Hi friends can you pls tell me what is wrong in my program. I am trying to remove those linker errors but not able to clear them.

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

    Default Re: Protocol Implementation. ?

    Did you link with the library?

  19. #17
    Join Date
    Mar 2008
    Posts
    46
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    2

    Default Re: Protocol Implementation. ?

    Ya i did link every thing but i have this error. !! All the example qextserialport programs
    work perfectly but the one i created has these link error's.


    Thank You

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

    Default Re: Protocol Implementation. ?

    Could you show your project file? Does QExtSerialPort contain the constructor mentioned in the error? Also make sure you got the class name right. Is it QextSerialPort or QExtSerialPort?

  21. #19
    Join Date
    Oct 2007
    Location
    Cracow
    Posts
    56
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    1
    Thanked 10 Times in 10 Posts

    Default Re: Protocol Implementation. ?

    hi, I've got version 1.1 of qextserialport from http://qextserialport.sourceforge.net/ which is differ from this on web, the difference is in example in file meesagewindow.cpp, I've got comments in line 92 and 93
    // if (static_cast<MessageWindow::EventType>(event->type()) == MessageWindow::MessageEvent)
    // msgTextEdit.append(dynamic_cast<MessageEvent::Mess ageEvent* >(event)->msg);
    and in line 121
    // QCoreApplication:ostEvent(this, new MessageEvent::MessageEvent(qmsg));
    with this comments it's work fine but when I delete them I get the same errors as you

Similar Threads

  1. Readonly Model implementation requirements for QComboBox
    By DeepDiver in forum Qt Programming
    Replies: 6
    Last Post: 8th November 2007, 17:10
  2. QUdpSocket error
    By mdecandia in forum Qt Programming
    Replies: 8
    Last Post: 25th October 2007, 10:47
  3. UI implementation style
    By goes2bob in forum Qt Tools
    Replies: 2
    Last Post: 15th August 2007, 23:37
  4. RubberBand zoom implementation for images
    By cdemirkir in forum Qt Programming
    Replies: 4
    Last Post: 16th July 2007, 22:55
  5. Qt and Uni-verse Networking Protocol
    By dvmorris in forum Qt Programming
    Replies: 0
    Last Post: 11th April 2007, 09:23

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
  •  
Qt is a trademark of The Qt Company.