Results 1 to 20 of 24

Thread: QSerialDevice v 0.2.0 released

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: QSerialDevice v 0.2.0 released

    Hello and thanks for your quick reply.

    I was finally able to compile the CSerialDevice library for VS2008 (I'm not sure yet it works with virtual ports though), and thought I'd just describe my steps to make it work for below in the post (I've also included all the CMakeLists files). Now I have also compiled the SerialDeviceInfo example, but using virtual ports on my PC, it seems that they are not recognized. I still need to check things out a bit, but would anybody have insights on that matter?

    Unrelated question : now that the project is on Gitorious, is this website the place where I should post these remarks/questions, or should I ask them on Gitorious ?

    1) I downloaded the latest version of the library on Gitorious

    2) I included a missing #include <QObject> header where missing

    3) I corrected a PCVOID error by adding a #define PCVOID LPCVOID in nativeserialengine.h

    4) In the cmake file, the moc files can either be created using:

    * qt4_wrap_cpp(MOC_SRCS ${MOC_SRCS}) : it creates some moc_xxx.cxx files included at the end of serialnotifier_p_win.cpp and serialdevicewatcher_p_win.cpp. Even after replacing the #include "moc_xxx.cpp" by "moc_xxx.cxx" at the end of the files to remove compiler errors, I couldn't remove the errors mentioned in the previous posts, I think that it is due to a problem of compiling order (it seems that vs2008 creates the moc_xxx.cxx files but then does not compile them.

    * qt4_automoc(${SRCS}) : to make this work,
    - I had to add at the beginning of every file inheriting QObject a #include "myclass.moc" (abstractserial.cpp, abstractserialengine.cpp, nativeserialengine.cpp, serialnotifier.cpp, serialdeviceinfo.cpp serialdevicewatcher.cpp
    - I had to remove the #include "moc_xxx.cxx" at the end of serialnotifier_p_win.cpp and serialdevicewatcher_p_win.cpp.

    After all this I still had a linker error: __declspec(dllimport) public: static class QString __cdecl QString::fromWCharArray(wchar_t const *,int). This is due to a wrong setting in the default config properties of vs2008: you need to set properties->configuration options->C++-> language->"treat wchar_t as integrated type" or some name like that to NO (actually, I think that this is only needed in the qserialdeviceinfoLib project but i haven't confirmed).
    This option can be set through the CMakes using this:
    set_target_properties(qserialdeviceinfoLib PROPERTIES COMPILE_FLAGS "/Zc:wchar_t-")
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSerialDevice v 0.2.0 released

    2 zazarb

    (I'm not sure yet it works with virtual ports though),
    What exactly does not work? AbstractSerial or SerialDeviceWatcher or SerialDeviceInfo?
    If SerialDeviceInfo - then try a new experimental class SeialDeviceEnumerator!

    where I should post these remarks/questions, or should I ask them on Gitorious ?
    Yes, now the project is at Gitorgious. Bugs and ask questions there. Or send e-mail me at. Let's stay together to deal with problems.

    After all this I still had a linker error: __declspec(dllimport) public: stat
    Maybe you need to change the file "qserialdevice_global.h" i.e. part macros Q_DECL_EXPORT etc.
    I realized this is bad, because wanted to be able to compile the library as static and shared for all compilers and all operating systems.
    If you follow the recommendations of the Nokia "Creating Shared Libraries" (search in QtAssistant) and make "qserialdevice_global.h" as they say - it will compile only the shared library.
    Last edited by kuzulis; 13th August 2010 at 13:11.

  3. #3

    Default Re: QSerialDevice v 0.2.0 released

    Hello,
    Actually, by applying all the modifications that I posted in the previous email, and by installing a nice virtual serial port software, I was able to build the whole library+examples correctly, everything works fine !
    Thanks for your help, and I'll move to Gitorious now if i have further questions/problems.
    Sandrine

Similar Threads

  1. QSerialDevice Problem
    By waynew in forum Qt Programming
    Replies: 8
    Last Post: 21st January 2010, 14:31
  2. QSerialDevice
    By clinisbut in forum Qt Programming
    Replies: 2
    Last Post: 23rd October 2009, 13:30
  3. [solved] QSerialDevice: How to set baudrate?
    By schlingel in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2009, 11:52
  4. Library QSerialDevice v 0.1.0 released
    By kuzulis in forum Qt Programming
    Replies: 0
    Last Post: 15th September 2009, 06:47
  5. new library QSerialDevice
    By kuzulis in forum Qt Programming
    Replies: 2
    Last Post: 13th July 2009, 05:42

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.