gpt4 book ai didi

c - 如何在 ubuntu 14.04 上安装 .c 和 Makefile 驱动程序

转载 作者:太空狗 更新时间:2023-10-29 12:29:40 25 4
gpt4 key购买 nike

我是新手。我正在尝试在 Ubuntu 14.04 上安装 CH340 驱动程序,但我不知道从哪里开始。这是 arduino clone 的驱动程序该文件夹有一个 Makefile 和 ch34x.c。我试图用 GCC 编译 ch34x.c,但出现错误。

~/Downloads/CH341SER_LINUX$ gcc -o driver ch34x.c
ch34x.c:20:24: fatal error: linux/init.h: No such file or directory
#include <linux/init.h>
^
compilation terminated.

在我得到的目录中运行 make 时:

make -C /lib/modules/3.8.11/build  M=/home/mko/Downloads/CH341SER_LINUX  
make: *** /lib/modules/3.8.11/build: No such file or directory. Stop.
make: *** [default] Error 2

文档信息:

Instructions

Note: 1.Please run followed executable programs as root privilege
2.Current Driver support versions of linux kernel range from 2.6.25 to 3.9.10
3.Current Driver support 32bits and 64bits linux systems

Usage:
(load or unload linux driver of CH34x)
//compile
#make
//load ch34x chips driver
#make load
//unload ch34x chips driver
#make unload

我使用“uname -r”检查了我的内核版本并得到了 3.8.11

最佳答案

这似乎是油炸面包丁特有的问题。这是明显的解决方法:

首先,您需要支持 https,在使用 crouton 创建 chroot 时默认情况下不会安装它。所以安装下面的包。

sudo apt-get install apt-transport-https

现在你需要添加我的公钥,因为我签署了包。使用以下命令执行此操作。

wget -O - "https://raw.github.com/divx118/crouton-packages/master/mauricevankruchten@gmail.com.gpg.key" | sudo apt-key add -

将 apt 仓库添加到您的 sources.list

sudo vi /etc/apt/sources.list

在文件中添加以下行。

deb https://raw.github.com/divx118/crouton-packages/master/ saucy main

然后您应该能够运行这些命令来修复 header

sudo apt-get update
sudo umount /lib/modules/3.8.11
sudo apt-get install linux-headers-3.8.11
sudo apt-get install linux-image-3.8.11

注意:我目前只在 saucy 上测试过它。这应该适用于 HP chromebook 14、Acer C720 和 Dell 11。

来源: https://github.com/dnschneid/crouton/issues/772#issuecomment-40894248

关于c - 如何在 ubuntu 14.04 上安装 .c 和 Makefile 驱动程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31430786/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com