解决 fatal error: asm/bitsperlong.h: No such file or directory #include <asm/bitsperlong.h>

这篇具有很好参考价值的文章主要介绍了解决 fatal error: asm/bitsperlong.h: No such file or directory #include <asm/bitsperlong.h>。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

问题:
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: No such file or directory #include <asm/bitsperlong.h>
make -C /lib/modules/5.4.0-146-generic/build M=/home/book/LinuxDriver/code/01_module modules
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-146-generic'
  CC [M]  /home/book/LinuxDriver/code/01_module/hello.o
In file included from ./include/asm-generic/int-ll64.h:11:0,
                 from ./arch/arm/include/uapi/asm/types.h:5,
                 from ./include/uapi/linux/types.h:5,
                 from ./include/linux/compiler.h:249,
                 from ./include/linux/init.h:5,
                 from /home/book/LinuxDriver/code/01_module/hello.c:7:
./include/uapi/asm-generic/int-ll64.h:12:10: fatal error: asm/bitsperlong.h: No such file or directory
 #include <asm/bitsperlong.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
scripts/Makefile.build:270: recipe for target '/home/book/LinuxDriver/code/01_module/hello.o' failed
make[2]: *** [/home/book/LinuxDriver/code/01_module/hello.o] Error 1
Makefile:1767: recipe for target '/home/book/LinuxDriver/code/01_module' failed
make[1]: *** [/home/book/LinuxDriver/code/01_module] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-146-generic'
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 2

查看路径其实是存在该文件的

fatal error: asm/bitsperlong.h: no such file or directory,linux,arm开发,运维

最终问题解决:

​ 使用命令查看当前是否设置了其他交叉编译工具链

echo $CROSS_COMPILE

​ 若存在,比如我在~/.bashrc 中 永久设置了ARM架构交叉编译工具链,而本次我需要生成的是x86架构的驱动程序,所以将~/.bashrc中间交叉编译工具链设置代码去掉即可

fatal error: asm/bitsperlong.h: no such file or directory,linux,arm开发,运维
打开新的终端,即可make成功

最后的话
这是因为当在~/.bashrc中永久设置了arm的交叉编译工具链时,它会影响到所有终端会话和shell。这可能会导致编译器在寻找头文件和库时查找错误的路径。注释掉这些设置后,编译器将使用默认的路径查找头文件和库,这可能会解决编译错误。建议在需要使用交叉编译工具链时,使用临时设置或者在特定的shell会话中设置,而不是永久设置在~/.bashrc文件中。

文章来源地址https://www.toymoban.com/news/detail-778323.html

到了这里,关于解决 fatal error: asm/bitsperlong.h: No such file or directory #include <asm/bitsperlong.h>的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • fatal error: opencv2/opencv.hpp: No such file or directory

    这是因为opencv头文件的路径中多了一个opencv4的文件夹:/usr/include/opencv4/opencv2 可以将opencv2文件夹链接到include文件夹下

    2024年02月11日
    浏览(33)
  • fatal error: linux/compiler-gcc9.h: No such file or directory

    linux 找到README文件 mzh@DESKTOP-GITL67P:~$ gcc --version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   因为当前gcc版本是9.x, 找不到 compiler-gcc

    2024年02月09日
    浏览(40)
  • gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory

    今天在Linux操作系统上开发C语言的时候,写好了一个helloword代码,想直接用gcc编译运行, 没想到直接给报错!!!

    2024年02月10日
    浏览(28)
  • 找不到opencv2/opencv.hpp,fatal error: opencv2/opencv.hpp: No such file or directory

    在CMakeLists.txt  当中添加你的opencv.hpp 路径即可。 我的opencv.hpp  在 /usr/include/opencv2/ INCLUDE_DIRECTORIES(/usr/include/opencv2/) 通过命令 include_directories 来设置头文件的搜索目录

    2024年02月12日
    浏览(30)
  • fatal error: opencv2/opencv_modules.hpp: No such file or directory(linux系统,opencv4)

    目的:在linux安装配置opencv2,出现了很多问题。总结一下。 1安装过程: 1)下载opencv 和opencv_contrib 其中my_working_directory为下载opencv的目录。因为需要第三方opencv_contrib库,因此下载。 2)编译opencv 和opencv_contrib 将opencv-contrib模块移入opencv目录下。 在上述目录中,创建bui

    2024年02月16日
    浏览(37)
  • 【ubuntu】gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory

    在 ubuntu 20.04 系统中编译 graphlearning 源码时出现如下报错: 按照其他网友的方法,我使用了这条命令: sudo apt install g++-aarch64-linux-gn 但很不幸,又出现新的新的报错: 报错复报错,报错何其多。与其查博客,不如看信息。 于是乎,我还是老老实实地回到最开始,报错的信息

    2024年02月12日
    浏览(38)
  • 解决Git配置error:could not lock config file....No such file or directory

    新安装git出现无法设置用户名和邮箱的方法。 $ git config --global user.name “用户名” $ git config --global user.email “邮箱” 当在git bash里设置用户名邮箱出现类似以下提示时的解决方法。 GIT error: could not lock config file C:/Users/FZQ/Desktop/%USERPROFILE%/…No such file or directory 这里说在我的电

    2024年02月06日
    浏览(35)
  • Mac解决Error: No such file or directory @ rb_sysopen报错问题

    问题小记:在Mac上安装SVN是如果缺少相关依赖包,则会出现类似标题的报错信息 说明缺少相关依赖包,再次执行brew install apr命令安装相关依赖包。 最后再重新执行brew install subversion命令则可以成功安装。 通过brew list可查看当前的安装文件  

    2024年02月16日
    浏览(35)
  • 微信小程序编译的错误解决办法:Error: accessSync:fail no such file or directory

    ~~本人在微信小程序中编写代码,使用到ESP8266-F12WiFi模块,代码没问题,但在真机调试中出现的一个错误,问了老大,本来解决的,但过了一个中午,又报错了,自己在网上一直搜,没搜到有效答案,经过多次试验,终于找到解决办法。 ~~Error: accessSync:fail no such file or directo

    2024年02月11日
    浏览(48)
  • 成功解决“assert.h”: No such file or directory error: command failed with exit code 2

    成功解决“assert.h”: No such file or directory  error: command   failed with exit code 2 目录 解决问题 解决思路 解决方法 IDE之VS:Visual Studio2022版本安装图文教程之详细攻略 fatal error C1083: 无法打开包括文件: “assert.h”: No such file or directory   error: command \\\'D:\\\\Program Files\\\\Microsoft Vis

    2024年02月11日
    浏览(78)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包