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. how to fix " Missing argument to '-L' " error ?
Forum Update on Monday, May 27th 2025

how to fix " Missing argument to '-L' " error ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
33 Posts 4 Posters 11.8k Views
  • 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.
  • A Offline
    A Offline
    Ahti
    wrote on 15 Jun 2017, 09:30 last edited by
    #1

    Hi

    I was working on a project in qt but suddenly it generated a strange error saying :

    error: missing argument to '-L'

    what is that ? and how should i fix it ?

    please help.
    thanks

    what is a signature ?? Lol

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JohanSolo
      wrote on 15 Jun 2017, 10:08 last edited by
      #2

      Could you show your .pro file?
      What exactly do you mean by "suddenly"? Did a restart, update occur between the working and non-working state?

      `They did not know it was impossible, so they did it.'
      -- Mark Twain

      A 1 Reply Last reply 15 Jun 2017, 10:12
      2
      • J JohanSolo
        15 Jun 2017, 10:08

        Could you show your .pro file?
        What exactly do you mean by "suddenly"? Did a restart, update occur between the working and non-working state?

        A Offline
        A Offline
        Ahti
        wrote on 15 Jun 2017, 10:12 last edited by
        #3

        @JohanSolo

        #-------------------------------------------------
        #
        # Project created by Ahtisham 2016-08-16T13:18:59
        #
        #-------------------------------------------------
        
        QT       += core gui
        
        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
        
        TARGET = testMyProject
        TEMPLATE = app
        
        
        SOURCES += main.cpp\
               eyecare.cpp \
           others.cpp
        
        HEADERS  += eyecare.h \
           others.h
        
        FORMS    += eyecare.ui
        
        RESOURCES += \
           images.qrc
        
        
        win32:CONFIG(release,debug|release): LIBS += -L&&PWD/Dll/ -ldxva2
        win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -ldxva2
        else:unix: LIBS += -L$$PWD/Library/ -ldxva2
        
        INCLUDEPATH += $$PWD/Library
        DEPENDPATH += $$PWD/Library
        
        win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Library/ -luser32
        else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -luser32
        else:unix: LIBS += -L$$PWD/Library/ -luser32
        
        INCLUDEPATH += $$PWD/Library
        DEPENDPATH += $$PWD/Library
        
        DISTFILES +=
        

        no neither restart nor update occurred but i don't know what caused this problem it was working fine.

        what is a signature ?? Lol

        K 1 Reply Last reply 15 Jun 2017, 12:03
        0
        • E Offline
          E Offline
          Eddy
          wrote on 15 Jun 2017, 11:55 last edited by
          #4

          If you lucky you can clean (or even delete) the target folder)
          Then run qmake + build.

          Did you change any folders or library names?

          Do you use a version system? Then you can compare the differences?

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          2
          • A Ahti
            15 Jun 2017, 10:12

            @JohanSolo

            #-------------------------------------------------
            #
            # Project created by Ahtisham 2016-08-16T13:18:59
            #
            #-------------------------------------------------
            
            QT       += core gui
            
            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
            
            TARGET = testMyProject
            TEMPLATE = app
            
            
            SOURCES += main.cpp\
                   eyecare.cpp \
               others.cpp
            
            HEADERS  += eyecare.h \
               others.h
            
            FORMS    += eyecare.ui
            
            RESOURCES += \
               images.qrc
            
            
            win32:CONFIG(release,debug|release): LIBS += -L&&PWD/Dll/ -ldxva2
            win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -ldxva2
            else:unix: LIBS += -L$$PWD/Library/ -ldxva2
            
            INCLUDEPATH += $$PWD/Library
            DEPENDPATH += $$PWD/Library
            
            win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Library/ -luser32
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -luser32
            else:unix: LIBS += -L$$PWD/Library/ -luser32
            
            INCLUDEPATH += $$PWD/Library
            DEPENDPATH += $$PWD/Library
            
            DISTFILES +=
            

            no neither restart nor update occurred but i don't know what caused this problem it was working fine.

            K Offline
            K Offline
            koahnig
            wrote on 15 Jun 2017, 12:03 last edited by koahnig
            #5

            @Ahti said in how to fix " Missing argument to '-L' " error ?:

            @JohanSolo

            #-------------------------------------------------
            #
            # Project created by Ahtisham 2016-08-16T13:18:59
            #
            #-------------------------------------------------
            
            QT       += core gui
            
            greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
            
            TARGET = testMyProject
            TEMPLATE = app
            
            
            SOURCES += main.cpp\
                   eyecare.cpp \
               others.cpp
            
            HEADERS  += eyecare.h \
               others.h
            
            FORMS    += eyecare.ui
            
            RESOURCES += \
               images.qrc
            
            
            win32:CONFIG(release,debug|release): LIBS += -L&&PWD/Dll/ -ldxva2
            win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -ldxva2
            else:unix: LIBS += -L$$PWD/Library/ -ldxva2
            
            INCLUDEPATH += $$PWD/Library
            DEPENDPATH += $$PWD/Library
            
            win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Library/ -luser32
            else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -luser32
            else:unix: LIBS += -L$$PWD/Library/ -luser32
            
            INCLUDEPATH += $$PWD/Library
            DEPENDPATH += $$PWD/Library
            
            DISTFILES +=
            

            no neither restart nor update occurred but i don't know what caused this problem it was working fine.

            In here shall be probably a '$' sign

            win32:CONFIG(release,debug|release): LIBS += -L&&PWD/Dll/ -ldxva2
            

            change to

            win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
            

            Vote the answer(s) that helped you to solve your issue(s)

            A 1 Reply Last reply 15 Jun 2017, 12:34
            4
            • K koahnig
              15 Jun 2017, 12:03

              @Ahti said in how to fix " Missing argument to '-L' " error ?:

              @JohanSolo

              #-------------------------------------------------
              #
              # Project created by Ahtisham 2016-08-16T13:18:59
              #
              #-------------------------------------------------
              
              QT       += core gui
              
              greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
              
              TARGET = testMyProject
              TEMPLATE = app
              
              
              SOURCES += main.cpp\
                     eyecare.cpp \
                 others.cpp
              
              HEADERS  += eyecare.h \
                 others.h
              
              FORMS    += eyecare.ui
              
              RESOURCES += \
                 images.qrc
              
              
              win32:CONFIG(release,debug|release): LIBS += -L&&PWD/Dll/ -ldxva2
              win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
              else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -ldxva2
              else:unix: LIBS += -L$$PWD/Library/ -ldxva2
              
              INCLUDEPATH += $$PWD/Library
              DEPENDPATH += $$PWD/Library
              
              win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Library/ -luser32
              else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -luser32
              else:unix: LIBS += -L$$PWD/Library/ -luser32
              
              INCLUDEPATH += $$PWD/Library
              DEPENDPATH += $$PWD/Library
              
              DISTFILES +=
              

              no neither restart nor update occurred but i don't know what caused this problem it was working fine.

              In here shall be probably a '$' sign

              win32:CONFIG(release,debug|release): LIBS += -L&&PWD/Dll/ -ldxva2
              

              change to

              win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
              
              A Offline
              A Offline
              Ahti
              wrote on 15 Jun 2017, 12:34 last edited by Ahti
              #6

              @koahnig

              Now i get these errors:

              https://ibb.co/eE4GiQ

              :(

              what is a signature ?? Lol

              1 Reply Last reply
              0
              • A Offline
                A Offline
                Ahti
                wrote on 15 Jun 2017, 12:41 last edited by
                #7

                After doing what @Eddy said the app started to work :)

                what is a signature ?? Lol

                E 1 Reply Last reply 15 Jun 2017, 12:51
                1
                • A Ahti
                  15 Jun 2017, 12:41

                  After doing what @Eddy said the app started to work :)

                  E Offline
                  E Offline
                  Eddy
                  wrote on 15 Jun 2017, 12:51 last edited by
                  #8

                  @Ahti

                  Good deal!

                  Qt Certified Specialist
                  www.edalsolutions.be

                  A 1 Reply Last reply 15 Jun 2017, 12:53
                  1
                  • E Eddy
                    15 Jun 2017, 12:51

                    @Ahti

                    Good deal!

                    A Offline
                    A Offline
                    Ahti
                    wrote on 15 Jun 2017, 12:53 last edited by Ahti
                    #9

                    @Eddy lol it still gives those 3 errors :(

                    what is a signature ?? Lol

                    1 Reply Last reply
                    0
                    • E Offline
                      E Offline
                      Eddy
                      wrote on 15 Jun 2017, 12:59 last edited by Eddy
                      #10

                      Good to see it's funny to you ;-)

                      Can you edit the link to you image or just copy the text here? We cannot see the image in your previous post.
                      You can use an image provider to show it to us by following this topic
                      There is still a problem with the uploading of image in the Qt forum. The admins are working on it though.

                      Edit : did you check the hint from @koahnig ?

                      Qt Certified Specialist
                      www.edalsolutions.be

                      A 1 Reply Last reply 15 Jun 2017, 13:07
                      1
                      • E Eddy
                        15 Jun 2017, 12:59

                        Good to see it's funny to you ;-)

                        Can you edit the link to you image or just copy the text here? We cannot see the image in your previous post.
                        You can use an image provider to show it to us by following this topic
                        There is still a problem with the uploading of image in the Qt forum. The admins are working on it though.

                        Edit : did you check the hint from @koahnig ?

                        A Offline
                        A Offline
                        Ahti
                        wrote on 15 Jun 2017, 13:07 last edited by Ahti
                        #11

                        @Eddy see i edited the post

                        changing from && to $$ ? yes i did that but now i am gettings those errors

                        note the problem is with those Dll files i know it because when i delete them and run my project it works.

                        what is a signature ?? Lol

                        1 Reply Last reply
                        0
                        • E Offline
                          E Offline
                          Eddy
                          wrote on 15 Jun 2017, 13:16 last edited by
                          #12

                          why do you have those 2 lines?

                          win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
                          win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
                          

                          Is one of them not enough?
                          The Dll path seems redundant since you don't use it further on

                          Qt Certified Specialist
                          www.edalsolutions.be

                          A 1 Reply Last reply 15 Jun 2017, 13:48
                          0
                          • E Eddy
                            15 Jun 2017, 13:16

                            why do you have those 2 lines?

                            win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
                            win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
                            

                            Is one of them not enough?
                            The Dll path seems redundant since you don't use it further on

                            A Offline
                            A Offline
                            Ahti
                            wrote on 15 Jun 2017, 13:48 last edited by Ahti
                            #13

                            @Eddy

                            Okay removed everything except :

                            win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
                            

                            but still getting those 3 errors

                            I use that Dll file for getting some windows functions that i need in my project.
                            functions like :
                            GetDesktopWindow();
                            MonitorFromWIndow();
                            GetCurrentBrightness();
                            etc

                            what is a signature ?? Lol

                            K 1 Reply Last reply 15 Jun 2017, 14:13
                            0
                            • E Offline
                              E Offline
                              Eddy
                              wrote on 15 Jun 2017, 13:55 last edited by
                              #14

                              what is in your $$PWD/Dll/ folder?

                              Qt Certified Specialist
                              www.edalsolutions.be

                              A 1 Reply Last reply 15 Jun 2017, 15:46
                              1
                              • A Ahti
                                15 Jun 2017, 13:48

                                @Eddy

                                Okay removed everything except :

                                win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
                                

                                but still getting those 3 errors

                                I use that Dll file for getting some windows functions that i need in my project.
                                functions like :
                                GetDesktopWindow();
                                MonitorFromWIndow();
                                GetCurrentBrightness();
                                etc

                                K Offline
                                K Offline
                                koahnig
                                wrote on 15 Jun 2017, 14:13 last edited by
                                #15

                                @Ahti said in how to fix " Missing argument to '-L' " error ?:

                                @Eddy

                                Okay removed everything except :

                                win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
                                

                                but still getting those 3 errors

                                I use that Dll file for getting some windows functions that i need in my project.
                                functions like :
                                GetDesktopWindow();
                                MonitorFromWIndow();
                                GetCurrentBrightness();
                                etc

                                The problem ist that this is only working for release. Therefore, you need to be sure that you are in release mode.
                                Also sometimes it is good to rerun qmake and possibly rebuild your libraries.

                                Vote the answer(s) that helped you to solve your issue(s)

                                1 Reply Last reply
                                1
                                • E Eddy
                                  15 Jun 2017, 13:55

                                  what is in your $$PWD/Dll/ folder?

                                  A Offline
                                  A Offline
                                  Ahti
                                  wrote on 15 Jun 2017, 15:46 last edited by
                                  #16

                                  @Eddy

                                  3 windows dll files

                                  dxva2.dll, dxva264.dll and user32.dll

                                  what is a signature ?? Lol

                                  K 1 Reply Last reply 15 Jun 2017, 15:47
                                  0
                                  • A Ahti
                                    15 Jun 2017, 15:46

                                    @Eddy

                                    3 windows dll files

                                    dxva2.dll, dxva264.dll and user32.dll

                                    K Offline
                                    K Offline
                                    koahnig
                                    wrote on 15 Jun 2017, 15:47 last edited by
                                    #17

                                    @Ahti said in how to fix " Missing argument to '-L' " error ?:

                                    @Eddy

                                    3 windows dll files

                                    dxva2.dll, dxva264.dll and user32.dll

                                    no libs with those file names?
                                    The dlls are used during run time, but while linking you need to have the libs created together with the dlls there.

                                    Vote the answer(s) that helped you to solve your issue(s)

                                    A 1 Reply Last reply 15 Jun 2017, 15:58
                                    0
                                    • K koahnig
                                      15 Jun 2017, 15:47

                                      @Ahti said in how to fix " Missing argument to '-L' " error ?:

                                      @Eddy

                                      3 windows dll files

                                      dxva2.dll, dxva264.dll and user32.dll

                                      no libs with those file names?
                                      The dlls are used during run time, but while linking you need to have the libs created together with the dlls there.

                                      A Offline
                                      A Offline
                                      Ahti
                                      wrote on 15 Jun 2017, 15:58 last edited by
                                      #18

                                      @koahnig

                                      now i got the libs but still getting that error :(

                                      what is a signature ?? Lol

                                      K 1 Reply Last reply 15 Jun 2017, 16:04
                                      0
                                      • A Ahti
                                        15 Jun 2017, 15:58

                                        @koahnig

                                        now i got the libs but still getting that error :(

                                        K Offline
                                        K Offline
                                        koahnig
                                        wrote on 15 Jun 2017, 16:04 last edited by
                                        #19

                                        @Ahti said in how to fix " Missing argument to '-L' " error ?:

                                        @koahnig

                                        now i got the libs but still getting that error :(

                                        What is the actual error message with your current configuration?
                                        Probably it would be good also to post the current .pro file.

                                        Vote the answer(s) that helped you to solve your issue(s)

                                        A 1 Reply Last reply 16 Jun 2017, 12:59
                                        0
                                        • K koahnig
                                          15 Jun 2017, 16:04

                                          @Ahti said in how to fix " Missing argument to '-L' " error ?:

                                          @koahnig

                                          now i got the libs but still getting that error :(

                                          What is the actual error message with your current configuration?
                                          Probably it would be good also to post the current .pro file.

                                          A Offline
                                          A Offline
                                          Ahti
                                          wrote on 16 Jun 2017, 12:59 last edited by
                                          #20

                                          @koahnig

                                          those three errors that i already mentioned.

                                          my new pro file:

                                          #-------------------------------------------------
                                          #
                                          # Project created by Ahtisham 2016-08-16T13:18:59
                                          #
                                          #-------------------------------------------------
                                          
                                          QT       += core gui
                                          
                                          greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                                          
                                          TARGET = testMyProject
                                          TEMPLATE = app
                                          
                                          
                                          SOURCES += main.cpp\
                                                  eyecare.cpp \
                                              others.cpp
                                          
                                          HEADERS  += eyecare.h \
                                              others.h
                                          
                                          FORMS    += eyecare.ui
                                          
                                          RESOURCES += \
                                              images.qrc
                                          
                                          
                                          win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Dll/ -ldxva2
                                          win32:CONFIG(release,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
                                          else:win32:CONFIG(debug,debug|release): LIBS += -L$$PWD/Library/ -ldxva2
                                          else:unix: LIBS += -L$$PWD/Library/ -ldxva2
                                          
                                          INCLUDEPATH += $$PWD/Library
                                          DEPENDPATH += $$PWD/Library
                                          
                                          win32:CONFIG(release, debug|release): LIBS += -L$$PWD/Library/ -luser32
                                          else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/Library/ -luser32
                                          else:unix: LIBS += -L$$PWD/Library/ -luser32
                                          
                                          INCLUDEPATH += $$PWD/Library
                                          DEPENDPATH += $$PWD/Library
                                          
                                          DISTFILES +=
                                          
                                          

                                          what is a signature ?? Lol

                                          K 1 Reply Last reply 16 Jun 2017, 13:06
                                          0

                                          1/33

                                          15 Jun 2017, 09:30

                                          • Login

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