Error copying files into build directory with .pro commands (Filename has + in name)
-
Hey Guys,
i have some issues when copying my needed files/folders into my build directory...
It all worked fine until i got a file/dll with a + in its name: libstdc++-6.dllNow here is how i am doing it in my .pro File:
# Deploy to debug or release directory based on the build configuration CONFIG(debug, debug|release) { deploy.path = $$OUT_PWD/debug } else { CONFIG(release, debug|release) { deploy.path = $$OUT_PWD/release } } # Add the paths for the files to copy COPY_CONFIG = settings.ini\ res/snap7-full-1.4.0/release/Windows/Win32/snap7.dll\ $$absolute_path($$[QT_HOST_BINS])/libgcc_s_dw2-1.dll\ $$absolute_path($$[QT_HOST_BINS])/libstdc++-6.dll\ $$absolute_path($$[QT_HOST_BINS])/libwinpthread-1.dll\ $$absolute_path($$[QT_HOST_BINS])/Qt5Core.dll\ $$absolute_path($$[QT_HOST_BINS])/Qt5Gui.dll\ $$absolute_path($$[QT_HOST_BINS])/Qt5Svg.dll\ $$absolute_path($$[QT_HOST_BINS])/Qt5Widgets.dll\ # Add the copying rule for files copy_cmd.input = COPY_CONFIG copy_cmd.output = $$deploy.path/${QMAKE_FILE_IN_BASE}${QMAKE_FILE_EXT} copy_cmd.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} copy_cmd.CONFIG += no_link_no_clean copy_cmd.variable_out = PRE_TARGETDEPS QMAKE_EXTRA_COMPILERS += copy_cmd # Add the copying rule for folders COPY_DIR = Styles camera_images #add more folders with empty space inbetween copydir_cmd.input = COPY_DIR copydir_cmd.output = $$deploy.path/${QMAKE_FILE_IN_BASE} copydir_cmd.commands = xcopy /s /q /y /i ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} copydir_cmd.CONFIG += no_link no_clean copydir_cmd.variable_out = PRE_TARGETDEPS QMAKE_EXTRA_COMPILERS += copydir_cmd
The build process works fine if i do not include the line where i set the filepath for my libstdc++-6.dll
This is the error i get:
20:41:20: Führe Schritte für Projekt GUI_PLC_Comm aus... 20:41:20: Unveränderte Konfiguration, qmake-Schritt wird übersprungen. 20:41:20: Starte "C:\Qt\Qt5.9.7\Tools\mingw530_32\bin\mingw32-make.exe" C:\Qt\Qt5.9.7\5.9.7\mingw53_32\bin\qmake.exe -o Makefile ..\GUI_PLC_Comm\GUI_PLC_Comm.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug" C:/Qt/Qt5.9.7/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'C:/qtprojekte/PLCCommMBM2/build-GUI_PLC_Comm-Desktop_Qt_5_9_7_MinGW_32bit-Debug' copy /y ..\..\..\Qt\Qt5.9.7\5.9.7\mingw53_32\bin\libstdc++-6.dll debug\libstdc++-6.dll Das System kann die angegebene Datei nicht finden. Makefile.Debug:119: recipe for target 'debug/libstdc++-6.dll' failed mingw32-make[1]: *** [debug/libstdc++-6.dll] Error 1 mingw32-make[1]: Leaving directory 'C:/qtprojekte/PLCCommMBM2/build-GUI_PLC_Comm-Desktop_Qt_5_9_7_MinGW_32bit-Debug' Makefile:36: recipe for target 'debug' failed mingw32-make: *** [debug] Error 2 20:41:22: Der Prozess "C:\Qt\Qt5.9.7\Tools\mingw530_32\bin\mingw32-make.exe" wurde mit dem Rückgabewert 2 beendet. Fehler beim Erstellen/Deployment des Projekts GUI_PLC_Comm (Kit: Desktop Qt 5.9.7 MinGW 32bit) Bei der Ausführung von Schritt "Make" 20:41:22: Verstrichene Zeit: 00:02.
The german language basically says that the system cant find the file, and then the compiler got an error.
But i know that the file is available there seems to be some issue with the + signs in it since i already tested it with a file i created myself and it doesnt work as soon as i put a + into the name.What can i do here?
Thanks in advance!!!
Best Regards
Daniel -
Hi,
It would likely be simpler to use windeployqt to do that task. The command is made to grab all your application dependencies and put it with the executable.
That said, did you try to escape the file name ?