[solved] Using dll results in makefile which will not work



  • I created a minimal Qt Widget project with the wizard. Then I copied the folder with the dll and lib I want to use to my project folder.

    After that I added the lib to my pro file. This looks like this:

    @
    QT += core gui

    LIBS += -L "E:/QtProjects/Test_Import01/FTDI/i386" -lftd2xx

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = Test_Import01
    TEMPLATE = app

    INCLUDEPATH += "."

    SOURCES += main.cpp
    dialog.cpp

    HEADERS += dialog.h

    FORMS += dialog.ui
    @

    After I start compiling I get this error
    @:-1: error: LNK1146: no argument specified with option '/LIBPATH:'@

    After looking in the make.debug file I noticed that there is an space between /LIBPATH: and the path of ftd2xx (E:/QtProjects...) in the LIBS line.

    @LIBS = qtmaind.lib /LIBPATH: E:/QtProjects/Test_Import01/FTDI/i386 ftd2xx.lib /LIBPATH:C:\Qt\Qt5\5.1.0\msvc2010\lib C:\Qt\Qt5\5.1.0\msvc2010\lib\Qt5Widgetsd.lib C:\Qt\Qt5\5.1.0\msvc2010\lib\Qt5Guid.lib C:\Qt\Qt5\5.1.0\msvc2010\lib\Qt5Cored.lib libEGLd.lib libGLESv2d.lib gdi32.lib user32.lib @

    If I remove this space, save the file and recompile, everything works fine. Is this a bug or am I doing something wrong?

    I'm using Qt 5.1.0 with MSVC2010.


  • Lifetime Qt Champion

    Hi,

    No it's not a bug, the correct syntax is to have the path appended to -L without any space.



  • That's it...

    Thank you!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.