Qt Project - application depending on a DLL file
-
mmm Okay...
Indeed, when i put the DLL file into exe directory i don't have any error, that's run alright.Thanks for explaining me differences between DLL and *a/*lib files, that is very useful !
I think i will just copy the DLL directly by a C++ function from project1 to project2,My problem is solved, thanks again for wasting your time for a begginer like me ;)
Cheers !
-
for this purpose you would be better off using QMAKE_POST_LINK, which will be executed after the build process has finished.
E.g. for windows:
@
win32:QMAKE_POST_LINK = copy <source-path>\*.dll <target-path>
@or alternatively call a bat file (shell script) which does everything you need after building finished.
-
that is the Qt command i have written in order to copy my DLL into my directory
@win32:QMAKE_POST_LINK = copy /Y $$PWD/../libDeclarativeScriptParser/release/libDeclarativeScriptParser.dll $$PWD/release@
But this does not work :/ it is strange, i have found many examples about it, and all used this command. But when i use it i don't have my DLL in my target directory :/
What if i used a "copy" function in my program ?
-
did you rerun qmake after you did add this line inorder to update the makefiles accordingly?
-
Sorry for my later reply
here is my command line :
@win32:QMAKE_POST_LINK = $${QMAKE_COPY} ../libDeclarativeScriptParser/release/libDeclarativeScriptParser.dll release/@When i run my qmake, there is showing an error
@The process "C:\QtSDK\mingw\bin\mingw32-make.exe" has been terminated - error code : 2@
-
Hi,
You have to give a more complete error log, this one doesn't say much
-
here are my errors
@mingw32-make: *** [release] Error 2
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" has been terminated - error code : 2
step "Make" execution error@but i have no more logs :/
I don't have any error when i build the application without this "copy" command line -
Are you sure the paths are correct ?
-
When executing the copy, you might not be in the directory you think. Try to make something like:
@cd@in place of your current copy command to see where you are