Problem during linker phase - "collect2.exe: fatal error: CreateProcess: No such file or directory"

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem during linker phase - "collect2.exe: fatal error: CreateProcess: No such file or directory"

Jump to solution
1,601 Views
flexeos
Contributor II

Hi 

 

I have a project for IMXRT1166 with a huge amount of files. I use MCUXpresso 11.6.0 in Windows 10

 

When adding further files to the project compilation is successful but during linker phase I have this error:

"collect2.exe: fatal error: CreateProcess: No such file or directory"

 

Investigating I have found that there could be a limit for command length:

https://github.com/platformio/platform-espressif8266/issues/231

 

Is this the correct explanation for the issue?

Is there some workaround to reduce command length?

 

 

Thanks

0 Kudos
1 Solution
1,566 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Indeed - there's a 32K limit for the length of the command line. Looks like you're crossing that boundary with your project. This topic also links to an ancient Eclipse bug that was not yet fixed in the upstream CDT. See [1] for more details. There are some workarounds suggested there but it's your decision whether any of them is appropriate in your case.

One other suggestion would be to reorganize your code in logical "components" and create some static libraries. This way, you could avoid the described problem. Another quick fix would be to pass the inputs to the linker via a file. If you're just above the 32K limit, you could update the linker command to something like: 

echo ${INPUTS} > inputs.txt; ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} @inputs.txt

However you'll be limited by the same 32K command line size for the "echo" command.

Regards,
MCUXpresso IDE Support

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=72965

View solution in original post

1 Reply
1,567 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Indeed - there's a 32K limit for the length of the command line. Looks like you're crossing that boundary with your project. This topic also links to an ancient Eclipse bug that was not yet fixed in the upstream CDT. See [1] for more details. There are some workarounds suggested there but it's your decision whether any of them is appropriate in your case.

One other suggestion would be to reorganize your code in logical "components" and create some static libraries. This way, you could avoid the described problem. Another quick fix would be to pass the inputs to the linker via a file. If you're just above the 32K limit, you could update the linker command to something like: 

echo ${INPUTS} > inputs.txt; ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} @inputs.txt

However you'll be limited by the same 32K command line size for the "echo" command.

Regards,
MCUXpresso IDE Support

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=72965