Results 1 to 3 of 3

Thread: linking to 3rd party windows DLL

  1. #1
    Join Date
    Jan 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default linking to 3rd party windows DLL

    I want to move a desktop Windows app, which communicates with certain devices through a system USB port, from the Visual Studio development environment to the Qt environment. Qt makes the GUI interface very easy but accessing the USB port is not so simple. USB communication requires making calls to functions in a 3rd party DLL library (from FTDI, a USB chip maker). I found some discussion of this at StackOverflow (http://stackoverflow.com/questions/2...ng-dll-into-qt) but there was some disagreement about best methods.

    1) Does Qt provide any documentation to support the programming and build? (i.e. importing function prototypes, linking to the library, ..)

    2) Is there a better approach to USB communication in Qt?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,677
    Thanks
    13
    Thanked 1,596 Times in 1,524 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: linking to 3rd party windows DLL

    Quote Originally Posted by shan View Post
    1) Does Qt provide any documentation to support the programming and build? (i.e. importing function prototypes, linking to the library, ..)
    If you use Qmake to build your project then you want to adjust the INCLUDEPATH and LIBS entries (look in the Qmake docs). Search in this forum... the topic has been gone over several times. If you are using CMake or something else then Qt documentation will not help.

    If the library exports C++ objects (mangled names) then you must match the compilers (i.e. almost mandates MSVC). If the library exports on C (plain) names then either MingW or MSVC will work.

    2) Is there a better approach to USB communication in Qt?
    No.

  3. #3
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: linking to 3rd party windows DLL

    Quote Originally Posted by shan View Post
    I want to move a desktop Windows app, which communicates with certain devices through a system USB port, from the Visual Studio development environment to the Qt environment. Qt makes the GUI interface very easy but accessing the USB port is not so simple. USB communication requires making calls to functions in a 3rd party DLL library (from FTDI, a USB chip maker).
    I use FTDI chips a lot and by far the easiest way to use them is to use the provided virtual serial port driver, and then you can talk to your device via Qextserialport and the like.

    FTDI also supply full library files and include files should you not wish to do this, so its just a matter of calling functions in that library. No need for importing functions from DLLs. The provided code from FTDI does all that for you.

Similar Threads

  1. Linux vs Windows 3rd party libraries
    By skepticalgeek in forum Newbie
    Replies: 4
    Last Post: 9th August 2010, 02:23
  2. Linking 3rd party libs on Mac OS X
    By jonks in forum Qt Programming
    Replies: 2
    Last Post: 21st June 2010, 07:03
  3. Replies: 2
    Last Post: 26th November 2009, 00:44
  4. Linking Third party Libraries
    By jsmith in forum Qt Programming
    Replies: 1
    Last Post: 13th October 2009, 07:18

Tags for this Thread

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.