fatal error: linux/compiler-gcc9.h: No such file or directory

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

linux

找到README文件

cd /mnt/e/CLionProjects/linux-3.10.99
sudo useradd linux3x
sudo passwd linux3x
sudo mkdir /home/linux3x
sudo chown linux3x:linu3x /home/linux3x
sudo chmod 755 /home/linux3x
su - linux3x
mkdir ~/build
mkdir ~/build/kernel
exit
make O=/home/linux3x/build/kernel menuconfig
make O=/home/linux3x/build/kernel
# sudo make O=/home/linux3x/build/kernel modules_install install

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-gcc9.h, 复制compiler-gcc5.h成compiler-gcc9.h

fatal error: linux/compiler-gcc9.h: No such file or directory,linux,运维,服务器

Kernel doesn't support PIC mode for compiling?

# force no-pie for distro compilers that enable pie by default
KBUILD_CFLAGS += $(call cc-option, -fno-pie)
KBUILD_CFLAGS += $(call cc-option, -no-pie)
KBUILD_AFLAGS += $(call cc-option, -fno-pie)
KBUILD_CPPFLAGS += $(call cc-option, -fno-pie)

cp E:\CLionProjects\linux-3.10.99\linux-3.10.99\include\linux\compiler-gcc5.h E:\CLionProjects\linux-3.10.99\linux-3.10.99\include\linux\compiler-gcc9.h

CLion头文件报错

fatal error: linux/compiler-gcc9.h: No such file or directory,linux,运维,服务器

标红,不能跳转

sudo cp -r ./include/linux/ /usr/local/include/

不要copy到/usr/include, 否则当前运行的操作系统坏了。

mzh@DESKTOP-GITL67P:/mnt/e/CLionProjects/linux-3.10.99/linux-3.10.99$ sudo rsync -avz ./include/ /usr/local/include/

但是这样会重复定义,所以还是用vim算了。

mzh@DESKTOP-GITL67P:/usr/local/include$ rm -rf acpi/ asm-generic/ clocksource/ config/ crypto/ drm/ dt-bindings/ generated/ keys/ linux3x/ math-emu/ media/ memory/ misc/ net/ pcmcia/ ras/ rdma/ rxrpc/ scsi/ sound/ target/ trace/ uapi/ video/ xen/

sudo apt-get install ctags

$ cat tags.sh

#/bin/bash

WORKDIR="/mnt/e/CLionProjects/linux-3.10.99"
find "${WORKDIR}" -name "*.[c|h]" | xargs ctags -f "${WORKDIR}/tags"
# find /usr/include -name "*.h" | xargs ctags -a "${WORKDIR}/tags"

ctags -a 表示追加索引内容到tags文件。Linux不依赖libc.so,所以不需要添加/usr/include。 

./tags.sh

在~/.vimrc中添加

set tags="/mnt/e/CLionProjects/linux-3.10.99/linux-3.10.99/tags"

对于报错Time skewed

sudo ntpdate -uv time.windows.com

linux TCP 代码在线查看

process解析

Misc on Linux fork, switch_to, and scheduling

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

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

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

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

相关文章

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

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

    2024年02月11日
    浏览(33)
  • vscode中解决头文件找不到问题,即fatal error: **.h: No such file or directory

    最近,在需要运行拥有头文件的cpp代码时候,vscode提示fatal error: **.h: No such file or directory 找不到头文件或所在目录。 这里记录一下我的解决办法。 1.设置launch.json 设置重点为加注释的句子   2.设置lauch.json 3. 按下F5 程序可正常寻找到头文件,输出结果正确 问题解决。 PS: 后

    2024年02月13日
    浏览(26)
  • 【OpenCV4】fatal error: opencv2/core.hpp: No such file or directory 解决方法

    Mac 系统 VScode OpenCV 4.5.4 在运行代码的时候出现报错 检查 c_cpp_properties.json , launch.json , tasks.json 这 3 个文件,参考: https://blog.csdn.net/qq_42067550/article/details/122634801?spm=1001.2014.3001.5502 查看 pkg-config 的设置 检查 vscode 工作区设置 在终端输入: 的到: 随便打开一个 访达 窗口,

    2023年04月08日
    浏览(33)
  • 解决 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 查看路径其实是存在该文件的 最终问题解决: ​ 使用命令查看当前是否设置了其他交叉编译工具链 ​ 若存在,比如我在~/.bashrc 中 永久设置了ARM架构交叉编译工具链,

    2024年02月03日
    浏览(21)
  • 编译 FastDFS 时报错 fatal error: sf/sf_global.h: No such file or directory 解决办法

    编译 FastDFS 时,报错如下 原因: 需要先编译和安装 libserverframe,新引入的网络框架库,下载地址:https://github.com/happyfish100 编译安装完后即可正常编译安装 FastDFS

    2024年02月21日
    浏览(28)
  • linux 写c, 编译报错 stdio.h: No such file or directory,compilation terminated.

    环境: windows11-subsystem(Ubuntu20) 问题: linux 写c, 编译报错如图(fatal error: stdio.h: No such file or directory │compilation terminated. #include stdio.h) 复现: 问题原因: 默认操作系统安装的gcc版本不对,和软硬件不兼容 解决方案 卸载默认gcc: build-essential: 它包含了 GNU 编辑器集合,GNU 调试器,和

    2024年02月13日
    浏览(27)
  • 找不到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)
  • docker: Error response from daemon: OCI runtime create failed: container_linux.go:318 no such file

    本地镜像默认工作目录为:/tmp/project,根据该镜像运行容器时报错,原因是:挂载的目录为/tmp/client/,而执行 npm i 命令时,进入的是client目录,解决方式:将命令修改为以下即可: cd /tmp/client/  npm i docker 运行时报错: 修改后的代码:

    2024年02月15日
    浏览(32)
  • nginx `error:2006D080:BIO routines:BIO_new_file:no such file error`

    现象: Nginx 配置文件中存在 SSL/TLS 相关的指令,并且指定了一个无效的证书文件路径。具体来说,Nginx 尝试加载 /opt/nginx/conf/none 文件作为证书文件,但该文件不存在,因此加载失败。 排查: 最终排查下来因为上游服务器不可用,随之ssl也无法继续提供,这个时候执行Nginx

    2024年02月15日
    浏览(21)
  • 解决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)

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

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

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

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

二维码1

领取红包

二维码2

领红包