解决树莓派4编译Protobuf报错undefined reference to `__atomic_fetch_add_8...

解决报错:undefined reference to `__atomic_fetch_add_8...

 

下载protobuf源码:

链接: https://pan.baidu.com/s/1vTNszh9WG-jpL97PKViqSQ 提取码: h6ck

 

LDFLAGS='-latomic' ./configure

make -j 4

sudo make install

 

树莓派其他环境问题:

解决Raspberry Pi安装libgtk2.0-dev出错的问题

sudo apt-get install libgtk2.0-dev

出错信息如下:

1

2

3

4

5

6

7

8

9

10

11

12

13

Reading package lists... Done

Building dependency tree      

Reading state information... Done

Some packages could not be installed. This may mean that you have

requested an impossible situation or if you are using the unstable

distribution that some required packages have not yet been created

or been moved out of Incoming.

The following information may help to resolve the situation:

 

The following packages have unmet dependencies:

libgtk2.0-dev : Depends: libpango1.0-dev (>= 1.20) but it is not going to be installed

                 Depends: libcairo2-dev (>= 1.6.4-6.1) but it is not going to be installed

E: Unable to correct problems, you have held broken packages.

根据出错信息,明显是软件源中出现了安装包缺失的问题。这个现象是不应该出现的。网上查询了不少地方,最终找到解决方法:

1

$ sudo vim /etc/apt/sources.list.d/raspi.list

可以看到如下内容:

1

2

3

#deb http://archive.raspberrypi.org/debian/ stretch main ui staging

# Uncomment line below then 'apt-get update' to enable 'apt-get source'

#deb-src http://archive.raspberrypi.org/debian/ stretch main ui

默认里面的内容都是被注释掉的,我们需要做的就是把这个源打开即可。
也可以直接执行如下命令来开启:

1

2

3

4

#先备份配置文件

$ sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak

 

$ sudo sed -i "s/^\#deb/deb/g" /etc/apt/sources.list.d/raspi.list

 

你可能感兴趣的:(IDE与GNU工具链)