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 Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved General and Desktop
33 Posts 4 Posters 12.5k Views 3 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.
  • AhtiA Ahti

    @koahnig

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

    K Offline
    K Offline
    koahnig
    wrote on 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)

    AhtiA 1 Reply Last reply
    0
    • K koahnig

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

      AhtiA Offline
      AhtiA Offline
      Ahti
      wrote on 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
      0
      • AhtiA Ahti

        @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 +=
        
        
        K Offline
        K Offline
        koahnig
        wrote on last edited by
        #21

        @Ahti

        Which means that the stubs in the lib-file are missing?
        Do you have the import and export keyword handled correctly?

        The dll and the stub-lib are generâted with the same tool chain?

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

        AhtiA 1 Reply Last reply
        0
        • K koahnig

          @Ahti

          Which means that the stubs in the lib-file are missing?
          Do you have the import and export keyword handled correctly?

          The dll and the stub-lib are generâted with the same tool chain?

          AhtiA Offline
          AhtiA Offline
          Ahti
          wrote on last edited by Ahti
          #22

          @koahnig what do you mean by "stubs in the lib-file" what is that ? i don't know anything about that. I just copied all the required dll and lib files from the system32 to Dll and Library folders of my project respectively. And what is import and export keyword ?

          I am creating this app just to let user change screen brightness and for that i need to use windows API and that is why i need those dll and lib files.

          have a look:

          https://msdn.microsoft.com/en-us/library/windows/desktop/dd692939(v=vs.85).aspx

          goto the link and see at the end in "Requirements" heading it clearly mentions which library and dll files you need to include in order to use that specific windows api function.

          what is a signature ?? Lol

          K 1 Reply Last reply
          0
          • AhtiA Ahti

            @koahnig what do you mean by "stubs in the lib-file" what is that ? i don't know anything about that. I just copied all the required dll and lib files from the system32 to Dll and Library folders of my project respectively. And what is import and export keyword ?

            I am creating this app just to let user change screen brightness and for that i need to use windows API and that is why i need those dll and lib files.

            have a look:

            https://msdn.microsoft.com/en-us/library/windows/desktop/dd692939(v=vs.85).aspx

            goto the link and see at the end in "Requirements" heading it clearly mentions which library and dll files you need to include in order to use that specific windows api function.

            K Offline
            K Offline
            koahnig
            wrote on last edited by
            #23

            @Ahti

            When creating a dll you will also create a library (it may have .lib as extension or .a depending on compiler). You need to link the library to your application which is using your dll. The library contains basically a reduced, short part (stub as the rest of tree when you have cut it down) .

            dllimport and dllexport it is called for MS compilers. An inpedendent way is with Q_DECL_IMPORT and Q_DECL_EXPORT

            What compiler are you using for creating your application?

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

            AhtiA 1 Reply Last reply
            0
            • K koahnig

              @Ahti

              When creating a dll you will also create a library (it may have .lib as extension or .a depending on compiler). You need to link the library to your application which is using your dll. The library contains basically a reduced, short part (stub as the rest of tree when you have cut it down) .

              dllimport and dllexport it is called for MS compilers. An inpedendent way is with Q_DECL_IMPORT and Q_DECL_EXPORT

              What compiler are you using for creating your application?

              AhtiA Offline
              AhtiA Offline
              Ahti
              wrote on last edited by
              #24

              @koahnig

              there you go:

              https://ibb.co/bDcoXk

              what is a signature ?? Lol

              K 1 Reply Last reply
              0
              • AhtiA Ahti

                @koahnig

                there you go:

                https://ibb.co/bDcoXk

                K Offline
                K Offline
                koahnig
                wrote on last edited by
                #25

                @Ahti

                From where did you get the include file HighLevelMonitorConfigurationAPI.h ?

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

                AhtiA 1 Reply Last reply
                0
                • K koahnig

                  @Ahti

                  From where did you get the include file HighLevelMonitorConfigurationAPI.h ?

                  AhtiA Offline
                  AhtiA Offline
                  Ahti
                  wrote on last edited by Ahti
                  #26

                  @koahnig I didn't get it from anywhere i just included it and qt responded on its own by mentioning it in the suggestion list. write this in your qt creator and it will give you a header file with this suggestion:

                  #include <highlevelmonitorconfigurationapi.h>
                  

                  what is a signature ?? Lol

                  K 1 Reply Last reply
                  0
                  • AhtiA Ahti

                    @koahnig I didn't get it from anywhere i just included it and qt responded on its own by mentioning it in the suggestion list. write this in your qt creator and it will give you a header file with this suggestion:

                    #include <highlevelmonitorconfigurationapi.h>
                    
                    K Offline
                    K Offline
                    koahnig
                    wrote on last edited by
                    #27

                    @Ahti

                    I got it. Never used it.

                    You are using a MinGW-C++ Gnu-compiler together with a MS library and dll.
                    I think in general this should be possible as long as the keywords are set properly which I would assume for this header file which is apparently part of MinGW.

                    Once again, please post the error output as to be found in your output pane. They may hold a clue of the problem.

                    BTW MS compilers are typically not compatible between its different version and certainly not with MinGW in general.

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

                    AhtiA 1 Reply Last reply
                    2
                    • K koahnig

                      @Ahti

                      I got it. Never used it.

                      You are using a MinGW-C++ Gnu-compiler together with a MS library and dll.
                      I think in general this should be possible as long as the keywords are set properly which I would assume for this header file which is apparently part of MinGW.

                      Once again, please post the error output as to be found in your output pane. They may hold a clue of the problem.

                      BTW MS compilers are typically not compatible between its different version and certainly not with MinGW in general.

                      AhtiA Offline
                      AhtiA Offline
                      Ahti
                      wrote on last edited by Ahti
                      #28

                      @koahnig

                      Here is the error output:
                      0_1498227345255_eyecare.h - testMyProject - Qt Creator 23-06-2017 19_44_39.png

                      what is a signature ?? Lol

                      K 1 Reply Last reply
                      0
                      • AhtiA Ahti

                        @koahnig

                        Here is the error output:
                        0_1498227345255_eyecare.h - testMyProject - Qt Creator 23-06-2017 19_44_39.png

                        K Offline
                        K Offline
                        koahnig
                        wrote on last edited by
                        #29

                        @Ahti

                        Need to copy and paste the content of the "Compile Output" pane. This is only a comprehesive summary telling almost nothing.

                        In the Compile Output pane you have the complete messages from the compile and linker. Typically you have black and blue fonts. When you have errors it starts at certain point to output with red font. There is typically the interesting part.

                        Not sure if I can see anything, but it is the next best option.

                        Mark the text where the problem starts plus a couple of lines before and after and with copy and paste post it here as source code. This shold be enough.

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

                        AhtiA 1 Reply Last reply
                        0
                        • K koahnig

                          @Ahti

                          Need to copy and paste the content of the "Compile Output" pane. This is only a comprehesive summary telling almost nothing.

                          In the Compile Output pane you have the complete messages from the compile and linker. Typically you have black and blue fonts. When you have errors it starts at certain point to output with red font. There is typically the interesting part.

                          Not sure if I can see anything, but it is the next best option.

                          Mark the text where the problem starts plus a couple of lines before and after and with copy and paste post it here as source code. This shold be enough.

                          AhtiA Offline
                          AhtiA Offline
                          Ahti
                          wrote on last edited by
                          #30

                          @koahnig

                          Compile Output:

                          0_1498238168735_library error.JPG

                          what is a signature ?? Lol

                          K 1 Reply Last reply
                          0
                          • AhtiA Ahti

                            @koahnig

                            Compile Output:

                            0_1498238168735_library error.JPG

                            K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #31

                            @Ahti

                            Sorry, this goes beyond my experience.
                            This is poking about in the fog. Possibly the wrong version of library, but I do not know.

                            You probably need to checkout the information around for MinGW.

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

                            AhtiA 2 Replies Last reply
                            1
                            • K koahnig

                              @Ahti

                              Sorry, this goes beyond my experience.
                              This is poking about in the fog. Possibly the wrong version of library, but I do not know.

                              You probably need to checkout the information around for MinGW.

                              AhtiA Offline
                              AhtiA Offline
                              Ahti
                              wrote on last edited by Ahti
                              #32

                              @koahnig

                              I have an old copy of my project in my desktop and that old copy works perfectly fine. so what i did is that i just took that old copy and replaced the codes in it with the new code of my new project and ran that old project and this is what i came up with :

                              0_1498892783250_win api error.JPG

                              I know its the same error which i encountered in my new copy of the project but whenever i got that error i was not able to locate it but with what i just did i was able to locate the source of the problem. so after including all the header files ( which i have missed ) i am still getting the problem. I included the dll as well as lib files as well but getting same error.

                              GetDesktopWIndow function requirements:

                              0_1498894960070_win api function des.JPG

                              what is a signature ?? Lol

                              1 Reply Last reply
                              0
                              • K koahnig

                                @Ahti

                                Sorry, this goes beyond my experience.
                                This is poking about in the fog. Possibly the wrong version of library, but I do not know.

                                You probably need to checkout the information around for MinGW.

                                AhtiA Offline
                                AhtiA Offline
                                Ahti
                                wrote on last edited by
                                #33

                                @koahnig

                                Look again at the compile output :

                                0_1498934912587_main.cpp - test - Qt Creator 02-07-2017 00_16_33.png

                                what is a signature ?? Lol

                                1 Reply Last reply
                                0

                                • Login

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