-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我把letter shell移植到linux平台,编译报错 #164
Comments
你好,邮件已收到,谢谢!
|
怎么解决呢 ? |
我把x86-demo的cmake指定交叉编译器生成makefile编译,也是一堆错误。: |
有部分是强制转换的错,你是不是使用的 clang,原先代码里面很多会报警告的强转,这个得花点时间处理下 |
什么时候出一个可以在嵌入式linux平台交叉编译通过的版本啊? 还有那个ld文件是必须得么? |
你的目标平台是什么,使用命令导出必须修改ld |
目标平台是imx6ull或者imx8m。 关键是这个ld我不知道该怎么改,能各个demo 么? |
这个和工具链关联太大了,有些工具链会修改,x86 的 demo 里面有一个改了的,针对 gcc |
你手头有交叉工具链么,改一个出来参考下 |
gcc编译是通过,运行没毛病。 我用imx6ull的交叉编译工具链就通过不了 |
lshell/source/shell.c:27:5: error: expected primary-expression before ‘.’ token
27 | .attr.value = SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_USER),
| ^
lshell/source/shell.c:28:5: error: expected primary-expression before ‘.’ token
28 | .data.user.name = shellCmdDefaultUser,
| ^
lshell/source/shell.c:29:5: error: expected primary-expression before ‘.’ token
29 | .data.user.password = shellPasswordDefaultUser,
| ^
lshell/source/shell.c:30:5: error: expected primary-expression before ‘.’ token
30 | .data.user.desc = shellDesDefaultUser
| ^
lshell/source/shell.c: In function ‘void shellInit(Shell*, char*, short unsigned int)’:
lshell/source/shell.c:202:71: error: cast from ‘const unsigned int*’ to ‘unsigned int’ loses precision [-fpermissive]
202 | shell->commandList.count = ((unsigned int)(&_shell_command_end)
| ^
lshell/source/shell.c:203:71: error: cast from ‘const unsigned int*’ to ‘unsigned int’ loses precision [-fpermissive]
203 | - (unsigned int)(&_shell_command_start))
| ^
lshell/source/shell.c:217:61: error: invalid conversion from ‘void*’ to ‘ShellCommand*’ {aka ‘shell_command*’} [-fpermissive]
217 | shell->commandList.base,
| ~~~~~~~~~~~~~~~~~~~^~~~
| |
| void*
lshell/source/shell.c:159:46: note: initializing argument 3 of ‘ShellCommand* shellSeekCommand(Shell*, const char*, ShellCommand*, short unsigned int)’
159 | ShellCommand base,
| ~~~~~~~~~~~~~~^~~~
lshell/source/shell.c: In function ‘short unsigned int shellWriteCommandDesc(Shell, const char*)’:
lshell/source/shell.c:331:22: error: ISO C++ forbids converting a string constant to ‘char*’ [-Werror=write-strings]
331 | shell->write("...", 3);
| ^~~~~
lshell/source/shell.c: In function ‘ShellCommand* shellSeekCommand(Shell*, const char*, ShellCommand*, short unsigned int)’:
lshell/source/shell.c:986:15: error: cast from ‘ShellCommand*’ {aka ‘shell_command*’} to ‘int’ loses precision [-fpermissive]
986 | ((int)base - (int)shell->commandList.base) / sizeof(ShellCommand);
| ^~~~
lshell/source/shell.c:986:46: error: cast from ‘void*’ to ‘int’ loses precision [-fpermissive]
986 | ((int)base - (int)shell->commandList.base) / sizeof(ShellCommand);
参考的是x86的那个例子
The text was updated successfully, but these errors were encountered: