# 8192 characters command line limit

**URL:** https://travis-ci.community/t/8192-characters-command-line-limit/7331
**Category:** Windows
**Created:** [February 23, 2020, 2:49am UTC](https://travis-ci.community/t/8192-characters-command-line-limit/7331 "2020-02-23T02:49:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kivutar](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/kivutar/32/138_2.png) [@kivutar](https://travis-ci.community/u/kivutar)
#### Post date: [February 23, 2020, 2:49am UTC](https://travis-ci.community/t/8192-characters-command-line-limit/7331/1 "2020-02-23T02:49:26Z")

</div>

Windows has a limit of 8192 characters for command line arguments.

This causes my ld to fail here [https://travis-ci.org/piepacker/fbneo/jobs/650323083](https://travis-ci.org/piepacker/fbneo/jobs/650323083)

With this error message:

```auto
g++.exe: error: CreateProcess: No such file or directory

```

Any idea of a workaround that doesn’t imply modifying the Makefile?

---

<div class="post-metadata">

### Author: ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)
#### Post date: [February 23, 2020, 1:02pm UTC](https://travis-ci.community/t/8192-characters-command-line-limit/7331/2 "2020-02-23T13:02:27Z")

</div>

First of all, are you sure the error is what you think it is? `g++.exe: error: CreateProcess: No such file or directory` suggests that instead, some other executable that `g++.exe` tries to invoke is missing.

* * *

[Solving the 8192 Character Command Line Limit on Windows | MCU on Eclipse](https://mcuoneclipse.com/2015/03/29/solving-the-8192-character-command-line-limit-on-windows/) suggests using an MSYS-based toolchain (that post suggests some obscure one; you would probably be fine with MinGW). The UNIX emulation layer that those executables contain passes command line arguments via an inherited pipe when invoking another MSYS-based process.

Another options is to [use a response file](https://gcc.gnu.org/wiki/Response_Files), a feature of GCC specifically present to overcome this limitation.

---

<div class="post-metadata">

### Author: ![kivutar](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/kivutar/32/138_2.png) [@kivutar](https://travis-ci.community/u/kivutar)
#### Post date: [March 2, 2020, 2:11pm UTC](https://travis-ci.community/t/8192-characters-command-line-limit/7331/3 "2020-03-02T14:11:37Z")

</div>

I’ve tried the response file but I can’t generate it properly on windows because of the same limit:

> <https://github.com/piepacker/fbneo/pull/1/commits/878ea02f6342c78dddbd0af2e8772ce1f66bbc8d>

The echo command fails because it’s too long.

---

<div class="post-metadata">

### Author: ![tanzislam](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/tanzislam/32/2591_2.png) [@tanzislam](https://travis-ci.community/u/tanzislam)
#### Post date: [November 8, 2020, 2:52pm UTC](https://travis-ci.community/t/8192-characters-command-line-limit/7331/4 "2020-11-08T14:52:03Z")

</div>

Instead of:

```auto
    $(foreach OBJ,$(OBJS),$(shell echo "$(OBJ)">>$@))

```

try the [`file` function](https://www.gnu.org/software/make/manual/html_node/File-Function.html#File-Function) introduced in [GNU Make v4.0](https://lists.gnu.org/archive/html/make-w32/2013-10/msg00021.html).
