SerialPortinfo::availableports()
-
SerialPortinfo :: availableports()
Am trying to list the Available port in system (Cmake), it showing error like
C:......\main.cpp:16: error: undefined reference to `__imp__ZN15QSerialPortInfo14availablePortsEv'
kindly Help to resolve this.
-
SerialPortinfo :: availableports()
Am trying to list the Available port in system (Cmake), it showing error like
C:......\main.cpp:16: error: undefined reference to `__imp__ZN15QSerialPortInfo14availablePortsEv'
kindly Help to resolve this.
@Imman_Manny
I don't use cmake, but have you done thetarget_link_libraries(mytarget PRIVATE Qt6::SerialPort)thing? -
@Imman_Manny
I don't use cmake, but have you done thetarget_link_libraries(mytarget PRIVATE Qt6::SerialPort)thing?Thank you for your Reply
yes, i did included Qt::6 serialport & serial Bus
Am a beginner kind help . Patiently -
@Imman_Manny
I don't use cmake, but have you done thetarget_link_libraries(mytarget PRIVATE Qt6::SerialPort)thing?@JonB
Thankyou so jonB , Am also tried the Qmake its worked Sucessfully . -
@JonB
Thankyou so jonB , Am also tried the Qmake its worked Sucessfully .@Imman_Manny
Are you using Qt6 or Qt5? -
@Imman_Manny
Are you using Qt6 or Qt5?@JonB QT6
-
@JonB QT6
@Imman_Manny
Qt6 itself has moved over to cmake (if you want to build it, access its internals etc.). You can still use qmake with it for your own projects. However the experts may recommend you change over to cmake yourself now. So you might want to revisit why yours does not work with cmake and sort it out. Perhaps someone else will comment. -
You would need both these in a CMakeLists.txt:
find_package(Qt6 REQUIRED COMPONENTS SerialPort) target_link_libraries(mytarget PRIVATE Qt6::SerialPort)and you would have had to install the "Qt Serial Port" option under additional libraries for the Qt version (6.4.1?) you are building against.
-
You would need both these in a CMakeLists.txt:
find_package(Qt6 REQUIRED COMPONENTS SerialPort) target_link_libraries(mytarget PRIVATE Qt6::SerialPort)and you would have had to install the "Qt Serial Port" option under additional libraries for the Qt version (6.4.1?) you are building against.
@ChrisW67 Thank you chris