ubuntu 找不到mysql.h_ubuntu安装了mysql 但是编译报错 mysql.h: No such file or directory

在Ubuntu系统中,安装了mysql但进行C编译时遇到找不到mysql.h的错误,原因是缺少mysql开发库,通过`sudo apt-get install libmysql++-dev`可解决。同时提到了Qt编译时GL/gl.h文件缺失的问题,解决办法是安装必要的图形库。此外,还提及了其他Ubuntu环境下编译错误的常见情况及解决方案。

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

在Ubuntu体系中,已经安装了mysql,即应用sudo apt-get install mysql-server mysql-client

但是用C编译mysql数据库时,报错

fatal error: mysql.h: No such file or directory

出现这个错误是因为体系没有安装mysql开发库

执行下面指令安装

sudo apt-get install libmysql++-dev

编译时须要加连接-lmysqlclient.

编译源法度的时辰,如下号令:

gcc -I/usr/include/mysql *.c -L/usr/lib/mysql -lmysqlclient -o *

Qt编译错误“GL/gl.h:No such file or directory”的解决方法

备注:1)操作系统:Ubuntu-14.04或12.042)Linux用户:root3)Qt版本:qt-linux-opensource-5.2.0-x86 为了迎接Qt的新纪元(从诺基亚移居到芬兰公 ...

Qt编译出错 GL/gl.h:No such file or directory

系统:Ubuntu18.04 软件:QtCreator4.8 Qt5.9.8 编译Qt Widgets Application类型的项目时,出现错误,提示: GL/gl.h: No such file ...

在cocos2d-x-3.0 android 平台编译时提示CocosGUI.h: No such file or directory

分类是个让人蛋疼的事情,所幸自己的博客自己做主.这是个高兴的开始. 每天抽空玩2048,终于忍受不住,于是决定自己从网上do