Ubuntu22.04编译报错

编译错误

以下错误都是我自己遇到的,参考网上的解决办法,有一些没有遇到,如果出现请自行搜索解决

libfakeroot.c:99:40: error: ‘_STAT_VER’ undeclared (first use in this function)
在libfakeroot.c 增加

#ifndef _STAT_VER
 #if defined (__aarch64__)
  #define _STAT_VER 0
 #elif defined (__x86_64__)
  #define _STAT_VER 1
 #else
  #define _STAT_VER 3
 #endif
#endif

c-stack.c:55:26: error: missing binary operator before token "(" 55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
进入c-stack.c的文件夹下

wget https://raw.githubusercontent.com/keyfour/openwrt/2722d51c5cf6a296b8ecf7ae09e46690403a6c3d/tools/m4/patches/011-fix-sigstksz.patch
patch c-stack.c < 011-fix-sigstksz.patch

gdbusauth.c:1302:11: error: ‘%s’ directive argument is null

if(line != NULL)
    debug_print ("SERVER: WaitingForBegin, read '%s'", line);

gdbusmessage.c:2702:30: error: ‘%s’ directive argument is null

if(signature_str!= NULL)
    tupled_signature_str = g_strdup_printf ("(%s)", signature_str);

(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin)😦.text+0x0): first defined here
多个 dtc-lexer.l 文件中的

YYLTYPE yylloc;

改为

extern YYLTYPE yylloc;

gstlib下的文件引用错误,错误很多,使用了最笨的办法将\去掉就行了,以下只是一个文件的错误
video-enumtypes.c error: stray '' in program

\#include "video.h" 
\#include "video-format.h" 
\#include "video-color.h" 
\#include "video-info.h" 
\#include "video-dither.h" 
\#include "colorbalance.h" 
\#include "navigation.h" 
\#include "video-chroma.h" 
\#include "video-tile.h" 
\#include "video-converter.h" 
\#include "video-resampler.h" 
\#include "video-frame.h" 
\#include "video-scaler.h"

改为

#include "video.h" 
#include "video-format.h" 
#include "video-color.h" 
#include "video-info.h" 
#include "video-dither.h" 
#include "colorbalance.h" 
#include "navigation.h" 
#include "video-chroma.h" 
#include "video-tile.h" 
#include "video-converter.h" 
#include "video-resampler.h" 
#include "video-frame.h" 
#include "video-scaler.h"

Ubuntu22.04报错:

报错1:
c-stack.c:55:26: error: missing binary operator before token "(" 55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384

解决办法:
进入c-stack.c的文件夹下

wget https://raw.githubusercontent.com/keyfour/openwrt/2722d51c5cf6a296b8ecf7ae09e46690403a6c3d/tools/m4/patches/011-fix-sigstksz.patch

patch c-stack.c < 011-fix-sigstksz.patch

报错2:
failure_signal_handler.cc:138:32: error: no matching function for call to ‘max(long int, int)’
  138 |   size_t stack_size = (std::max(SIGSTKSZ, 65536) + page_mask) & ~page_mask;
      |                        ~~~~~~~~^~~~~~~~~~~~~~~~~

解决办法:
在failure_signal_handler.cc:138:修改为
size_t stack_size = (std::max((long int)SIGSTKSZ, (long int)65536) + page_mask) & ~page_mask;

报错3:
DTB报错

解决办法:
https://blog.csdn.net/wanpengpenga/article/details/122313358 

### 解决方案 在 Ubuntu 22.04 上安装向日葵时可能会遇到依赖项缺失或其他兼容性问题。以下是针对该问题的具体解决方法: #### 方法一:调整桌面环境以适配向日葵 如果按照官方教程无法成功安装向日葵,可能是因为其默认依赖与当前系统的某些组件不匹配。可以通过更改桌面服务器来解决问题[^4]。 1. **切换到轻量级桌面环境** 如果当前使用的 GNOME 桌面环境存在问题,可以尝试更换为更简单的桌面管理器(如 XFCE 或 LXDE),这些环境通常对第三方工具的支持更好。 ```bash sudo apt update && sudo apt upgrade -y sudo apt install xfce4 -y ``` 2. **重新启动系统** 切换完成后需重启计算机以应用新设置。 ```bash sudo reboot ``` 3. **再次安装向日葵** 使用官方提供的 `.deb` 文件进行手动安装,并确保所有必要的库已正确加载。 ```bash wget https://download.oray.com/download/linux/deb/oray-sunlogin-client_latest_amd64.deb sudo dpkg -i oray-sunlogin-client_latest_amd64.deb sudo apt --fix-broken install -y ``` --- #### 方法二:避免修改系统底层依赖 强行替换系统依赖可能导致后续不稳定或不可预见的问题。因此建议采取更为稳妥的方式处理此类冲突[^1]。 1. **检查现有依赖状态** 验证是否存在未满足的依赖关系。 ```bash ldd /usr/bin/sunloginclient | grep "not found" ``` 2. **单独安装缺少的库** 对于检测出的丢失模块逐一补充。例如,若提示 `libssl.so.1.1` 缺失,则可通过以下命令修复: ```bash sudo add-apt-repository ppa:linuxuprising/libssl1.1 sudo apt update sudo apt install libssl1.1 ``` 3. **验证安装结果** 执行客户端程序确认是否恢复正常运行。 ```bash sunloginclient ``` --- #### 方法三:考虑替代远程控制方案 如果经过多次尝试仍未能顺利部署向日葵,可评估其他成熟的跨平台解决方案作为备选计划[^2]。 推荐选项包括但不限于 TeamViewer 和 ToDesk,它们均具备良好的 Linux 支持度且操作简便。 ```bash sudo snap install todesk ``` 或者通过源码编译方式获取最新版本 VNC Server 实现类似功能。 --- ### 注意事项 无论选用哪种途径都应提前做好数据备份工作以防万一发生意外情况影响日常作业流程[^3]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值