尽管安装了 unixODBC,但缺少 sql.h 头文件 [英] sql.h header file missing though unixODBC is installed

查看:38
本文介绍了尽管安装了 unixODBC,但缺少 sql.h 头文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是最新的 Ubuntu 12.04 系统.我安装了 unixodbc(来自 ubuntu repos 的 v2.2.14)、MySQL 及其相关驱动程序.还连接到有效的 DSN.通过发出 isql DBName UName passwd 进行验证.

I am on an up-to-date Ubuntu 12.04 system. I have unixodbc (v2.2.14 from ubuntu repos), MySQL and its relevant drivers installed. Also connected to a valid DSN. Verified by issuing isql DBName UName passwd.

我正在尝试编译一个使用 ODBC 与数据库交互的 C 应用程序.我搜索的几乎所有地方似乎都表明我应该在某处安装sql.h".find/-iname sql.h -print 显示我没有它.

I am trying to compile a C application that interacts with the database using ODBC. Almost everywhere I searched seemed to indicate that I should have "sql.h" installed somewhere. A find / -iname sql.h -print showed I don't have it.

所以我的问题是:它在哪里?安装有问题吗(虽然没有报告错误)?您建议采取哪些步骤?重装?从源代码编译(最新版本?)?

So my question is: where is it? Did something go wrong with the install (no errors were reported though)? And what steps do you recommend? Reinstallation? Compilation from source code (the latest version?)?

推荐答案

需要安装unixodbc-dev包来获取开发头文件.

You need to install the unixodbc-dev package to get the development header files.

sudo apt-get install unixodbc-dev

-dev 包包含编译和构建使用这些头文件调用库所需的头文件.库文件本身将是常规包的一部分,即 unixodbc 在您的情况下.

The -dev packages contain the require header files required to compile and build programs using these headers to make calls to the library. The library files themselves would be part of the regular package i.e. unixodbc in your case.

如果你想知道哪个包提供了某个文件,你可以使用apt-file:

If you want to know which package provides a certain file, you could use apt-file:

sudo apt-file update
sudo apt-file find sql.h

这篇关于尽管安装了 unixODBC,但缺少 sql.h 头文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆