how to fix " Missing argument to '-L' " error ?
-
@Ahti said in how to fix " Missing argument to '-L' " error ?:
#------------------------------------------------- # # 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
-
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 ?
-
-
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 -
@Ahti said in how to fix " Missing argument to '-L' " error ?:
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();
etcThe 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. -
@Ahti said in how to fix " Missing argument to '-L' " error ?:
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. -
@Ahti said in how to fix " Missing argument to '-L' " error ?:
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. -
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 +=
-
@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.
-
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?