[CMake] Error running link command: Argument list too long

Andrew Sayman andrew.sayman at gmail.com
Fri Aug 1 14:42:56 EDT 2008


On Fri, Aug 1, 2008 at 9:13 AM, Brad King <brad.king at kitware.com> wrote:
> All the fixes you've seen are for Windows with its 32k command line length
> limit.  This is the first time I've seen someone with so many object files
> that it gives Linux a problem.  What is the error message that you get?

"Error running link command: Argument list too long"

I have a feeling I may be off and on these forums as I try to complete
this. I'm converting a fairly large legacy C project to use CMake
because I'm tired of custom-to-each-machine perl Makefile generation
that we use.

There were other potential ways to resolve the dependencies other than
such a massive static library, but I don't know of a good CMake-style
way to integrate the --start-group and --end-group flags without
resorting to a bunch of really terse coding in my CMakeLists.txt.
Since part of my goal here is to show how much simpler it is to get
things going with CMake, I'd just rather not. If you know of a
property/variable that'll automatically toss in --start-group and
--end-groups I would love to know.

> Try adding the lines below to your project (just to see if it helps, not as
> a permanent solution).  They're from Windows-gcc.cmake and are used for long
> link lines on Windows.  They tell CMake how to split up the static archive
> creation into multiple invocations of the archiver.  If this helps we can
> probably just use the same thing for all platforms.

It definitely fixed the problem. Thanks a bunch.
-- 
Andrew Sayman


More information about the CMake mailing list