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. Error copying files into build directory with .pro commands (Filename has + in name)

Error copying files into build directory with .pro commands (Filename has + in name)

Scheduled Pinned Locked Moved Unsolved General and Desktop
pro filecopy filescompilingspecial charac
3 Posts 2 Posters 281 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.
  • M Offline
    M Offline
    mullman123
    wrote on 12 Jun 2024, 18:44 last edited by mullman123 6 Dec 2024, 18:46
    #1

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

    Now 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

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 12 Jun 2024, 18:54 last edited by
      #2

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply 12 Jun 2024, 19:29
      0
      • S SGaist
        12 Jun 2024, 18:54

        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 ?

        M Offline
        M Offline
        mullman123
        wrote on 12 Jun 2024, 19:29 last edited by
        #3

        @SGaist If you mean by escaping, putting it into quotes like "this" then yeah. Every possible combination x)

        Okay i will take a look at the windeployqt tool.

        1 Reply Last reply
        0

        3/3

        12 Jun 2024, 19:29

        • Login

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