title: Library linking error: undefined reference to _imp__
body: <p>I can't figure out how to link FTDI library in my Qt project. I copied ftd2xx.h file to my project directory. The file I want to link is dll: ftd2xx.lib which is stored in F:\Workspace\qt\libs\ftdi\amd64  </p>
  
  <p>I get error:</p>
  
  <pre><code>release/testftdi.o:testftdi.cpp:(.text+0x6f8): undefined reference to `_imp__FT_Open@8'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p>I have QtWidget application with one PushButton:</p>
  
  <p>TestFtdi.pro file:</p>
  
  <pre><code>QT       += core gui
  
  greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  
  TARGET = TestFtdi
  TEMPLATE = app
  
  LIBS += -L"F:\Workspace\qt\libs\ftdi\amd64" -lftd2xx
  INCLUDEPATH += f:/Workspace/qt/libs/ftdi/amd64
  
  SOURCES += main.cpp\
          testftdi.cpp
  
  HEADERS  += testftdi.h
  
  FORMS    += testftdi.ui
  </code></pre>
  
  <p>main.cpp file:</p>
  
  <pre><code>#include "testftdi.h"
  #include &lt;QApplication&gt;
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
      TestFtdi w;
      w.show();
  
      return a.exec();
  }
  </code></pre>
  
  <p>testftdi.h file:</p>
  
  <pre><code>#ifndef TESTFTDI_H
  #define TESTFTDI_H
  
  #include &lt;QMainWindow&gt;
  
  namespace Ui {
  class TestFtdi;
  }
  
  class TestFtdi : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit TestFtdi(QWidget *parent = 0);
      ~TestFtdi();
  
  private slots:
      void on_pushButton_clicked();
  
  private:
      Ui::TestFtdi *ui;
  };
  
  #endif // TESTFTDI_H
  </code></pre>
  
  <p>testftdi.cpp file:</p>
  
  <pre><code>#include "testftdi.h"
  #include "ui_testftdi.h"
  #include &lt;QDebug&gt;
  
  #include "windows.h"
  #include "ftd2xx.h"
  
  TestFtdi::TestFtdi(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::TestFtdi)
  {
      ui-&gt;setupUi(this);
  }
  
  TestFtdi::~TestFtdi()
  {
      delete ui;
  }
  
  void TestFtdi::on_pushButton_clicked()
  {
  
      FT_HANDLE ftHandle;
      FT_STATUS ftStatus;
  
  
      ftStatus = FT_Open(0, &amp;ftHandle);
      if(ftStatus != FT_OK) { // FT_Open failed
          qDebug() &lt;&lt; "FT_Open failed";
      }
  }
  </code></pre>
  
  <p>The compiler command looks in this situation like this:</p>
  
  <pre><code>g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release\TestFtdi.exe release/main.o release/testftdi.o release/moc_testftdi.o  -lmingw32 -LC:/Qt/5.5/mingw492_32/lib -lqtmain -lshell32 -LF:\Workspace\qt\libs\ftdi\Static\amd64 -lftd2xx -lQt5Widgets -lQt5Gui -lQt5Core 
  </code></pre>
  
  <p>Could you help me with this?</p>