error includes ftd2xx library
-
I tried to include the ftd2xx file but there was an error when I tried to run it, this is the code from my qmake```
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
SOURCES +=
main.cpp
mainwindow.cppHEADERS +=
ftd2xx.h
mainwindow.hFORMS +=
mainwindow.uiqnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetand this is my mainwindow code``` #include "mainwindow.h" #include "ui_mainwindow.h" #include <QDebug> #include <Windows.h> #include "ftd2xx.h" #include <stdio.h> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { FT_HANDLE ftHandle; FT_STATUS ftStatus; ftStatus = FT_Open(0,&ftHandle); }but when run there is this error```
:-1: error: debug/mainwindow.o: in functionMainWindow::on_pushButton_clicked()': C:\Users\Blackzero\Documents\TestFTDI\mainwindow.cpp:25: error: undefined reference to__imp_FT_Open'
:-1: error: collect2.exe: error: ld returned 1 exit status
:-1: error: [Makefile.Debug:73: debug/Test.exe] Error 1 -
I tried to include the ftd2xx file but there was an error when I tried to run it, this is the code from my qmake```
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
SOURCES +=
main.cpp
mainwindow.cppHEADERS +=
ftd2xx.h
mainwindow.hFORMS +=
mainwindow.uiqnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetand this is my mainwindow code``` #include "mainwindow.h" #include "ui_mainwindow.h" #include <QDebug> #include <Windows.h> #include "ftd2xx.h" #include <stdio.h> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_pushButton_clicked() { FT_HANDLE ftHandle; FT_STATUS ftStatus; ftStatus = FT_Open(0,&ftHandle); }but when run there is this error```
:-1: error: debug/mainwindow.o: in functionMainWindow::on_pushButton_clicked()': C:\Users\Blackzero\Documents\TestFTDI\mainwindow.cpp:25: error: undefined reference to__imp_FT_Open'
:-1: error: collect2.exe: error: ld returned 1 exit status
:-1: error: [Makefile.Debug:73: debug/Test.exe] Error 1@Blackzero You're not linking the library. See https://doc.qt.io/qt-6/qmake-variable-reference.html#libs
-
@Blackzero You're not linking the library. See https://doc.qt.io/qt-6/qmake-variable-reference.html#libs
-
@jsulm the problem has been resolved, it turns out that the ftd2xx I used is not compatible with x64, so I just changed the ftd2xx x86 to ftd2xx x64.
@Blackzero said in error includes ftd2xx library:
he problem has been resolved, it turns out that the ftd2xx I used is not compatible with x64, so I just changed the ftd2xx x86 to ftd2xx x64.
Please help me, I am new to Qt platform and I am having same issue as yours. I Just want to know where you downloaded the ftd2xx x64 (.h and .lib) so that I can download to fix my problem. Thank you!
-
@Blackzero said in error includes ftd2xx library:
he problem has been resolved, it turns out that the ftd2xx I used is not compatible with x64, so I just changed the ftd2xx x86 to ftd2xx x64.
Please help me, I am new to Qt platform and I am having same issue as yours. I Just want to know where you downloaded the ftd2xx x64 (.h and .lib) so that I can download to fix my problem. Thank you!
@tbb7178 hi and welcome to devnet,
It's in the driver download page of ftdi.