sql.h header file missing though unixODBC is installed

我是研究僧i 提交于 2019-11-26 20:53:14

问题


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.

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?)?


回答1:


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

sudo apt-get install unixodbc-dev

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.

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


来源:https://stackoverflow.com/questions/15447386/sql-h-header-file-missing-though-unixodbc-is-installed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!