Ubuntu下,数据库编程报错fatal error: mysql.h: No such file or directory 的处理方法

cpp 复制代码
#include <iostream>
#include <mysql++.h>

using namespace std;

int main()
{
    cout << "Hello MySQL++" << endl;
    return 0;
}

编译报错:

Build messages

/usr/local/include/mysql++/common.h|232|fatal error: mysql.h: No such file or directory|

Build log

/usr/local/include/mysql++/common.h:232:11: fatal error: mysql.h: No such file or directory

解决办法:

1.在终端里面搜索到mysql.h所在的路径

2.根据mysql.h所在的路径,再搜索一下,mysql的库文件所在路径,

  1. 然后配置一下codeblocks的全局变量mysql

4.配置一下工程的build options

  1. 再运行程序,就成功了
相关推荐
Zhu7581 天前
在k8s集群部署MySQL单实例,支持多个主流发行版
android·mysql·kubernetes
神王宝宝 王者小学1 天前
HBase: 看上去很美
大数据·数据库·hbase
io无心1 天前
Shardingsphere5分库分表
数据库·mysql
wWYy.1 天前
Mysql:主键索引 唯一索引 普通索引 前缀索引
数据库·mysql
我是小灰灰吖1 天前
Ubuntu 22.04 安装 SSH 服务与远程调试环境配置指南
qt·ubuntu·ssh
宝杰X71 天前
Android Room3 多平台数据库
android·数据库
sky_8106131 天前
Oracle ERP 各模块业务管理功能及底层表说明
数据库·oracle
YMatrix 官方技术社区1 天前
CittaBase vs. Neo4j :原生图性能实测与混合检索实践
数据库·功能测试·ymatrix
闲猫1 天前
LangChain / Integrations / Integrations by component / Tool
java·数据库·langchain
xqqxqxxq1 天前
SQL 连接查询技术笔记
数据库·笔记·sql