The command line is too long Qt5.14.2
-
Hello,
When am build a project in release mode from Qt creator and also cmd line, it throws error The command line is too long when am adding a copyQtdata cmd in pro file to copy a folder in bin/release.
In Debug there is no error, builds successfully and the folder is also copied in bin/debug.copyQtdata.commands += $(COPY_DIR) /f $$shell_path($$top_srcdir\CANvAS_Tasks) $$shell_path($$DESTDIR/CANvAS_Tasks) &
If I comment out that cmd, then it builds successfully in release mode.
Not able to understand the issue, as other team members are not facing this issue.Any suggestion is appreciated.
Thank you!
-
@sayan275
Can't see the full length of your command-line, but presumably it has exceeded whatever length Windows allows for one. It is possible that having to userelease
instead ofdebug
multiple times just pushes it over the limit?So far as I can see from the screenshot there are multiple
xcopy
commands each joined with an&
. Built by a whole bunch ofcopyQtdata.commands += ...
statements. So in some shape or form you need to shorten that. Can you build separate/multiple commands so one does not get too long? Can you factor the logic into a .bat file which takes suitable parameters (not so many) and executes multiple statements from there? -
@sayan275
No. (Unless the Qt/make process knows to split lines on;
and issue each command separately, which I doubt, but have no idea.) It is complaining that the built line incopyQtdata.commands
is too long. So you need to find a way to shorten it, either by having multiplecopyQtdata
so they each have separatecommands
(I know nothing about how you use this or whether it is built into Qt-build), or by maybe doing the copy via a.bat
script which can take a shorter command-line, or by some other means,