编译mg-samples-3.0.12报错:libminigui_ths.so: undefined reference to `WndClientRect'解决方法

本文介绍使用gcc5.2.0编译mg-samples-3.0.12时遇到的undefined reference错误,并提供了解决方案。通过移除特定函数前的inline关键字并重新编译库文件来解决问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

用gcc 5.2.0去编译mg-samples-3.0.12,报错:

.../lib/libminigui_ths.so: undefined reference to `WndClientRect'
.../lib/libminigui_ths.so: undefined reference to `pixel2rgb'

.../lib/libminigui_ths.so: undefined reference to `WndRect'

解决方法:

$cd libminigui-3.0.12-linux

$grep -r "WndClientRect" .

发现WndClientRect在libminigui-3.0.12-linux/src/newgdi/gdi.c中,将inline void WndRect(

higobear@ThinkPadX1:~$ google-chrome --enable-logging=stderr --v=1 [34991:34991:0328/224010.443817:VERBOSE1:chrome_crash_reporter_client.cc(187)] GetCollectStatsConsent(): settings_consent: 1 so returning that [34991:34991:0328/224010.449306:VERBOSE1:chrome_crash_reporter_client.cc(187)] GetCollectStatsConsent(): settings_consent: 1 so returning that [35006:35006:0328/224010.507887:VERBOSE1:cdm_registration.cc(234)] Choosing hinted Widevine 4.10.2891.0 from /opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so [1:1:0328/224010.507887:VERBOSE1:cdm_registration.cc(234)] Choosing hinted Widevine 4.10.2891.0 from /opt/google/chrome/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so [35006:35006:0328/224010.508324:INFO:cpu_info.cc(53)] Available number of cores: 8 [1:1:0328/224010.508326:INFO:cpu_info.cc(53)] Available number of cores: 8 [35006:35006:0328/224010.508569:VERBOSE1:zygote_main_linux.cc(201)] ZygoteMain: initializing 0 fork delegates [1:1:0328/224010.508601:VERBOSE1:zygote_main_linux.cc(201)] ZygoteMain: initializing 0 fork delegates [34991:34991:0328/224010.512618:VERBOSE1:statistics_recorder.cc(582)] Collections of all histograms Histogram: Chrome.ProcessSingleton.NotifyResult recorded 1 samples, mean = 1.0 (flags = 0x41) 0 O (0 = 0.0%) 1 -O (1 = 100.0%) {0.0%} 2 ... Histogram: Chrome.ProcessSingleton.TimeToNotify recorded 1 samples, mean = 0.0 (flags = 0x41) 0 -O (1 = 100.0%) 10 ... Histogram: Linux.SandboxStatus recorded 1 samples (flags = 0x41) 126 -O (1 = 100.0%) Histogram: Security.Sandbox.LandlockState recorded 1 samples, mean = 0.0 (flags = 0x41) 0 -O (1 = 10
最新发布
03-29
<think>嗯,用户想排查Google Chrome启动时的日志问题,特别是关于Widevine CDM的加载情况,还有Linux的沙盒状态和Landlock状态。首先,我需要回忆一下Chrome相关的命令行参数,尤其是日志记录和调试相关的选项。 记得Chrome有很多命令行开关,可以通过在启动时添加参数来启用日志。例如,--enable-logging和--v=1可以开启基本日志,而--vmodule=*/widevine/*=3可能会详细记录Widevine模块的信息。另外,Widevine CDM的初始化可能需要特定的参数,比如--enable-features=WidevineCdm或--disable-component-update,防止组件更新干扰。 关于沙盒状态,用户可能需要检查沙盒是否启用。--no-sandbox会禁用沙盒,但通常不建议这样做,除非为了调试。而Landlock是Linux内核的安全模块,可能需要查看内核日志或者使用dmesg来确认状态。 用户可能还关心如何找到生成的日志文件的位置。在Linux上,日志通常存储在~/.config/google-chrome/chrome_debug.log。此外,使用--user-data-dir可以指定自定义的用户数据目录,方便隔离测试。 另外,用户提供的参考链接中提到了ignoreDefaultArgs参数,这可能是在使用自动化工具如Puppeteer时需要注意的参数。需要确保在启动配置中正确设置这些参数,避免与日志记录冲突。 还需要考虑是否需要禁用沙盒来测试CDM加载问题,但必须提醒用户这样做存在安全风险,仅限调试使用。同时,检查Chrome的版本和Widevine CDM的版本是否兼容,可能需要手动更新CDM组件。 最后,生成相关问题时要覆盖日志分析、沙盒配置、CDM加载失败处理以及Landlock的调试方法,确保用户能全面了解排查步骤。</think>### Google Chrome日志排查与Widevine CDM加载分析 #### 一、启用详细日志记录 1. **基础日志参数** - 使用`--enable-logging`和`--v=1`启动基础日志: ```bash google-chrome --enable-logging --v=1 ``` - 日志文件默认路径:`~/.config/google-chrome/chrome_debug.log`(Linux) 2. **Widevine CDM专用日志** ```bash google-chrome --vmodule=*/widevine/*=3 --enable-logging ``` 该指令针对`widevine`路径下的模块启用三级详细日志[^1] 3. **沙盒状态验证** ```bash google-chrome --no-sandbox --disable-features=Landlock ``` ▢ `--no-sandbox`强制禁用沙盒(调试用,生产环境禁用) ▢ `--disable-features=Landlock`关闭Linux 5.13+的Landlock安全模块 #### 二、关键参数组合示例 ```bash google-chrome \ --enable-logging \ --v=2 \ --vmodule=&#39;*/components/cdm/*=3,*/widevine/*=3&#39; \ --enable-features=WidevineCdm \ --disable-component-update \ --user-data-dir=/tmp/chrome-test ``` ▢ `--disable-component-update` 禁止自动更新组件 ▢ `--user-data-dir` 创建独立用户目录避免配置干扰[^2] #### 三、日志分析方法 1. **Widevine CDM初始化标志** ```log [0925/153045.885305:VERBOSE1:widevine_cdm.cc(270)] Widevine CDM initialization started [0925/153045.885932:VERBOSE1:widevine_cdm.cc(301)] CDM storage path: /home/user/.config/google-chrome/WidevineCdm ``` 2. **沙盒状态检测** ```log [0925/153046.123456:INFO:zygote_host_impl_linux.cc(167)] Sandbox initialized [0925/153046.123789:WARNING:landlock.cc(55)] Landlock not supported by kernel ``` #### 四、常见问题处理 1. **CDM加载失败** - 检查`chrome://components`中`Widevine Content Decryption Module`状态 - 手动下载CDM组件: ```bash wget https://dl.google.com/widevine-
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值