Results 1 to 3 of 3

Thread: QSerialPortInfo error

  1. #1
    Join Date
    Sep 2017
    Posts
    29
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Windows

    Default QSerialPortInfo error

    I am working on simple app on windows to scan the serial port. Error:

    undefined reference to `_imp___ZN15QSerialPortInfo14availablePortsEv'
    My Code:

    foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
    // do something

    }
    What does the error mean and how to fix it.

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    506
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QSerialPortInfo error

    Hi, did you add
    QT += serialport
    to your .pro file?

    Ginsengelf

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QSerialPortInfo error

    Or if you are using Visual Studio and MSVC++, did you add Qt5SerialPort.lib to your project properties (Project -> Properties -> Configuration Properties -> Linker -> Additional Dependencies)

    Remember that in Windows, the Debug and Release configurations use different link libraries (Qt5SerialPortD.lib vs. Qt5SerialPort.lib, respectively), as well as different libraries for 32- vs. 64-bit builds.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. [serialport] QSerialPortInfo::availablePorts result
    By amreo in forum Qt Programming
    Replies: 3
    Last Post: 12th June 2016, 18:58
  2. QSerialPortInfo - Bluetooth SPP devices
    By BrianNorman in forum Qt Programming
    Replies: 16
    Last Post: 22nd February 2016, 14:18
  3. trouble with the QSerialPortInfo::availablePorts()
    By xiongxiongchuan in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2014, 09:42
  4. Replies: 3
    Last Post: 7th October 2013, 14:58
  5. QSerialPortInfo Broken
    By RolandHughes in forum Qt Programming
    Replies: 0
    Last Post: 21st June 2013, 15: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.