尝试编译代码时出现错误127

编程入门 行业动态 更新时间:2024-10-27 16:37:50
本文介绍了尝试编译代码时出现错误127的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

本学期,我学习了这个新主题,可以与Discovery STM32 F4一起使用,但我们仍处于设置阶段.但是我一开始就有这个问题.

This semester I got this new subject where we get to work with Discovery STM32 F4, and we are still in the phase of setting it up. But I have this problem in the beginning.

当我尝试编译此闪烁"代码时,出现此错误:

When I try to compile this "blink" code I get this error:

因此,到目前为止,我们正在使用此快捷命令"make"来编译代码,并且得到了如下所示进行设置的指令:

So, as I got it so far, we are using this shortcut command "make" to compile code, and we were given instruction to set it up as it's shown in images below:

有人可以看到这里有什么问题吗?

Can anyone see what's the problem here?

推荐答案

Error 127表示以下两件事之一:

Error 127 means one of two things:

找不到
  • 文件:您使用的路径不正确.仔细检查程序是否确实在您的$PATH中,或者在这种情况下,相对路径正确-请记住,随机终端的当前工作目录可能与您所使用的IDE不同.最好改用绝对路径.
  • 找不到
  • ldso:您使用的是预编译的二进制文件,并且它需要系统中没有的解释器.也许您使用的是x86_64(64位)发行版,但预构建的版本适用于x86(32位).您可以通过打开终端并尝试直接执行它来确定这是否是答案.或通过在/bin/sh上运行file -L(以获取默认/本机格式)以及在编译器本身上运行(以查看其格式).
  • file not found: the path you're using is incorrect. double check that the program is actually in your $PATH, or in this case, the relative path is correct -- remember that the current working directory for a random terminal might not be the same for the IDE you're using. it might be better to just use an absolute path instead.
  • ldso is not found: you're using a pre-compiled binary and it wants an interpreter that isn't on your system. maybe you're using an x86_64 (64-bit) distro, but the prebuilt is for x86 (32-bit). you can determine whether this is the answer by opening a terminal and attempting to execute it directly. or by running file -L on /bin/sh (to get your default/native format) and on the compiler itself (to see what format it is).
  • 如果问题是(2),则可以通过几种比较方法解决问题:

    if the problem is (2), then you can solve it in a few diff ways:

  • 获得更好的二进制文件.与为您提供工具链的供应商进行交流,并要求他们提供不会拖延的工具.
  • 查看您的发行版是否可以安装文件的multilib集.大多数x86_64 64位发行版允许您并行安装x86 32位库.
  • 使用类似 crosstool-ng 的工具构建自己的交叉编译器.
  • 您可以在x86_64& x86安装,但这似乎有点过分;).
  • get a better binary. talk to the vendor that gave you the toolchain and ask them for one that doesn't suck.
  • see if your distro can install the multilib set of files. most x86_64 64-bit distros allow you to install x86 32-bit libraries in parallel.
  • build your own cross-compiler using something like crosstool-ng.
  • you could switch between an x86_64 & x86 install, but that seems a bit drastic ;).
  • 更多推荐

    尝试编译代码时出现错误127

    本文发布于:2023-11-25 01:01:06,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1627672.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:出现错误   代码

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!