硬汉嵌入式论坛

 找回密码
 立即注册
查看: 331|回复: 4
收起左侧

[ThreadX全家桶] eclipse使用GCC编译netxduo文件太多,不能编译

[复制链接]
回帖奖励 14 个金币 回复本帖可获得 2 个金币奖励! 每人限 1 次

5

主题

53

回帖

68

积分

初级会员

积分
68
发表于 2025-9-3 21:10:08 | 显示全部楼层 |阅读模式
如图,Cannot run program "arm-none-eabi-gcc": Command line too long,有没有大佬知道怎么解决这个问题
编译问题.jpg
编译问题.jpg
回复

使用道具 举报

0

主题

65

回帖

65

积分

初级会员

积分
65
发表于 2025-9-4 08:57:04 | 显示全部楼层

回帖奖励 +2 个金币

看样子是 windows 系统命令长度限制,可能要改注册表啥的吧
或者试试 linux 环境编译,linux 环境肯定不会有这种问题
回复

使用道具 举报

0

主题

127

回帖

127

积分

初级会员

积分
127
发表于 2025-9-4 10:37:56 | 显示全部楼层

回帖奖励 +2 个金币

在eclipse项目中将所有netxduo的文件夹设为exclude,然后新建一个c文件include所有netxduo的文件夹里的c文件
回复

使用道具 举报

1万

主题

7万

回帖

11万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
118335
QQ
发表于 2025-9-4 11:28:28 | 显示全部楼层

回帖奖励 +2 个金币

直接CubeMX生成CubeIDE NETXDUO工程,看看配置项,方便参考对比
回复

使用道具 举报

0

主题

3

回帖

3

积分

新手上路

积分
3
发表于 2025-9-6 09:44:09 | 显示全部楼层
ar命令使用-M选项支持脚本输入,创建一个AR脚本, 包含所i有.o文件, 在eclipse里修改ar命令选项 ${COMMAND} -M “${workspace_loc:/netxduo/ar_script.txt}”。
创建ar脚本的powershell脚本代码:
[C] 纯文本查看 复制代码
# File: generate_ar_script.ps1
# Located at the root of the netxduo project

# Change the current directory to where the script is located
Push-Location $PSScriptRoot

# Directory containing the .o files
$debugDir = "./Debug"

# Get all .o files from the directory recursively
$oFiles = Get-ChildItem -Path $debugDir -Filter "*.o" -Recurse | ForEach-Object { $_.FullName }

# Begin creating the ar script
$arScript = @()
$arScript += "create libnetxduo.a"
$oFiles | ForEach-Object { $arScript += "ADDMOD $_" }


$arScript += "SAVE"

$arScript += "END"

# Output the ar script to a file
$arScript -join "`n" | Out-File "ar_script.txt" -Encoding ascii

# Return to the original directory
Pop-Location

Write-Output "AR Script generated successfully!"


输出文件参考ar_script.txt

ar_script.txt

86.91 KB, 下载次数: 0

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2025-9-26 19:32 , Processed in 0.051495 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表