[Qgis-developer] linker command line too long for cmd.exe

Benjamin Ducke benjamin.ducke at ufg.uni-kiel.de
Mon Nov 19 09:47:25 EST 2007


Tim,

(I should probably have mentioned that I am on Windows 2000,
who knows, maybe everybody else is using XP these days and
thus never had this problem)

For some reason, there is always trouble if an sh.exe is
in the path when using Cmake. It's hard to avoid that with
the MSYS shell.

Anyhow, moving either the QGIS source code or Qt around to
a shorter path does not help, as the excessive length of
the compiler line is simply caused by the number of objects
passed to it.

The line in question is the one that generates qgis.exe.
It starts with:

cd C:\qgis\build\src\app && C:\MinGW\bin\g++.exe -mwindows
"CMakeFiles/qgis.dir/main.obj" "CMakeFiles/qgis.dir/qgisapp.obj" ...

... and then goes on and on with "CMakeFiles/qgis.dir/<sth.obj> entries.

Now, I wonder: would it be possible to change into the deeper
directory before calling g++ and thus shorten all those items:

cd C:\qgis\build\src\app\CmakeFiles\qgis.dir && C:\MinGW\bin\g++.exe
-mwindows "main.obj" "qgisapp.obj" -o ..\..\qgis.exe <-L.. -l..>

???

This should reduce the length of that line drastically.

Regards,

Benjamin


Tim Sutton wrote:
> Hi
> 
> I haven't encountered this before.
> You could probably try to build in a msys shell.
> 
> Regards
> 
> Tim
> 
> 2007/11/19, Benjamin Ducke <benjamin.ducke at ufg.uni-kiel.de>:
>> Dear all,
>>
>> I am trying to compile QGIS SVN head using MinGW and have run into a
>> serious wall:
>>
>> When I 'make' the binaries, after the 52% compile step, I get:
>>
>> Linking CXX executable qgis.exe
>>
>> .. and after a few seconds an error message about the command line being
>> too long (uck!)!
>>
>> Now, I am pretty sure that the problem originates in cmd.exe, as the
>> error message is German ("Die eingegebene Zeile ist zu lang.") and I am
>> on a German system.
>>
>> I have tried replacing cmd.exe with a version from XP, which is supposed
>> to allow for longer commands, but to no avail.
>>
>> I have put the QGIS sources into a very short path in order to shorten
>> the linker line but that also did not help. I suppose I could try
>> re-installing Qt into a shorter path. What do you think?
>>
>> Has anyone had the same problems before?
>>
>> Is there a replacement for cmd.exe that does not have this limitation?
>>
>> Might there be a possibility to optimize the Makefile generated by CMake
>> so that it produces shorter linker command lines?
>>
>> Where do I have to look to see the actual linker line being used? Does
>> CMake have something like a verbose switch, so I am not stuck with the
>> percentage display and can see what's actually going on?
>>
>> I am grateful for any help on this one.
>>
>> Best,
>>
>> Benjamin
>>
>> --
>> Benjamin Ducke, M.A.
>> Archäoinformatik
>> (Archaeoinformation Science)
>> Institut für Ur- und Frühgeschichte
>> (Inst. of Prehistoric and Historic Archaeology)
>> Christian-Albrechts-Universität zu Kiel
>> Johanna-Mestorf-Straße 2-6
>> D 24098 Kiel
>> Germany
>>
>> Tel.: ++49 (0)431 880-3378 / -3379
>> Fax : ++49 (0)431 880-7300
>> www.uni-kiel.de/ufg
>>
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.qgis.org
>> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
>>
> 
> 

-- 
Benjamin Ducke, M.A.
Archäoinformatik
(Archaeoinformation Science)
Institut für Ur- und Frühgeschichte
(Inst. of Prehistoric and Historic Archaeology)
Christian-Albrechts-Universität zu Kiel
Johanna-Mestorf-Straße 2-6
D 24098 Kiel
Germany

Tel.: ++49 (0)431 880-3378 / -3379
Fax : ++49 (0)431 880-7300
www.uni-kiel.de/ufg




More information about the Qgis-developer mailing list