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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
3,508 次查看
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 项奖励
回复
1 解答
3,473 次查看
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

在原帖中查看解决方案

1 回复
3,474 次查看
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