Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. error includes ftd2xx library

error includes ftd2xx library

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 831 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Blackzero
    wrote on last edited by
    #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 gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    CONFIG += c++17

    SOURCES +=
    main.cpp
    mainwindow.cpp

    HEADERS +=
    ftd2xx.h
    mainwindow.h

    FORMS +=
    mainwindow.ui

    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target

    and 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 function MainWindow::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

    jsulmJ 1 Reply Last reply
    0
    • B Blackzero

      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 gui

      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

      CONFIG += c++17

      SOURCES +=
      main.cpp
      mainwindow.cpp

      HEADERS +=
      ftd2xx.h
      mainwindow.h

      FORMS +=
      mainwindow.ui

      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target

      and 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 function MainWindow::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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Blackzero You're not linking the library. See https://doc.qt.io/qt-6/qmake-variable-reference.html#libs

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      3
      • jsulmJ jsulm

        @Blackzero You're not linking the library. See https://doc.qt.io/qt-6/qmake-variable-reference.html#libs

        B Offline
        B Offline
        Blackzero
        wrote on last edited by
        #3

        @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.

        T 1 Reply Last reply
        0
        • B Blackzero

          @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.

          T Offline
          T Offline
          tbb7178
          wrote on last edited by
          #4

          @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!

          SGaistS 1 Reply Last reply
          0
          • T tbb7178

            @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!

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by SGaist
            #5

            @tbb7178 hi and welcome to devnet,

            It's in the driver download page of ftdi.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved