报错:[mysys_ssl/CMakeFiles/mysys_ssl.dir/my_default.cc.o] Error 1

本文记录了在使用cmake配置并尝试编译mysql-5.7.18时遇到的段错误问题及其解决过程。错误发生在my_default.cc文件中,并提示可能是硬件或操作系统的问题。通过安装glibc解决了该问题。

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

cmake已经过了,但是在make时报了以下错误:

/root/mysql-5.7.18/mysys_ssl/my_default.cc: In function ‘int my_search_option_files(const char*, int*, char***, uint*, int (*)(void*, const char*, const char*), void*, const char**, my_bool, my_bool)’:
/root/mysql-5.7.18/mysys_ssl/my_default.cc:441: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla>; for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [mysys_ssl/CMakeFiles/mysys_ssl.dir/my_default.cc.o] Error 1
make[1]: *** [mysys_ssl/CMakeFiles/mysys_ssl.dir/all] Error 2
make: *** [all] Error 2

在网上搜索了一下,有可能是 glibc没装。。。

[root@localhost ~]# yum install -y glibc
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
...

安装之后重新make

### 配置 GTK 头文件路径 为了使 Visual Studio Code (VSCode) 正确识别并解析 `gtk-3.0` 的头文件,在 Windows 环境下需确保安装了 GTK 开发库,并正确配置项目中的 includePath。 #### 安装 GTK 库 首先,下载适用于 Windows 平台的 GTK 工具包。可以从官方站点获取最新版本的 GTK+ Bundle 或通过 MSYS2 安装 GTK 和其他依赖项[^1]。 #### 更新 c_cpp_properties.json 文件 编辑 `.vscode/c_cpp_properties.json` 来指定包含 GTK 头文件的位置: ```json { "configurations": [ { "name": "Win32", "includePath": [ "${workspaceFolder}/**", "D:\\tools\\gtk+\\mysys\\ucrt64\\include\\**" ], "defines": ["_DEBUG", "UNICODE", "_UNICODE"], "compilerPath": "D:\\tools\\gtk+\\mysys\\mingw64\\bin\\gcc.exe", "cStandard": "c17", "intelliSenseMode": "windows-gcc-x64" } ], "version": 4 } ``` 此设置假设 GTK 已经被安装到了 D:\tools\gtk+\mysys\ucrt64\include\[^4]。如果实际路径不同,则应相应调整 `"includePath"` 中的具体位置。 #### 设置环境变量 为了让编译器能够找到 GTK 库及其关联资源,还需要将 GTK bin 目录添加到系统的 PATH 环境变量中。这一步骤对于命令行工具以及集成开发环境中调用外部构建脚本都是必要的[^2]。 #### 测试配置有效性 完成上述更改之后保存所有修改过的文件,重新启动 VSCode 让新的配置生效。尝试打开一个简单的 GTK 示例程序来验证是否可以成功编译运行[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值