0

I am trying to compile a simple C program on an UNIX machine which just has sql.h header statement to make sure that odbc headers are working.

But Im keep on getting this error.

error: sql.h: A file or directory in the path name does not exist

#include<stdio.h>
#include<sql.h>

main(){

}

I used this code because no matter what I put inside the Main fuction, the header itself fails.

But I have installed ODBCUnix . Here are the commands which shows ODBC status.

/apps/rmb/scripts$odbcinst --version unixODBC 2.3.0

odbcinst -j unixODBC 2.3.0 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini FILE DATA SOURCES..: /etc/ODBCDataSources USER DATA SOURCES..: /etc/odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8

Please advise how to compile this simple program .

DavidPostill
  • 7,734
  • 9
  • 41
  • 60
Jackson2489
  • 11
  • 3
  • 10
  • Have you checked this: http://stackoverflow.com/questions/15447386/sql-h-header-file-missing-though-unixodbc-is-installed – ragmha Feb 08 '15 at 08:57
  • I checked that... It Is asking to install dev package. Is there any way to find whether it is already Installed or not because I'm using production server – Jackson2489 Feb 08 '15 at 09:49
  • So where actually **is** `sql.h` located? Doing a `find / -name sql.h` what do you get? – alk Feb 08 '15 at 10:03
  • OT: It's `int main(void)` at least. – alk Feb 08 '15 at 10:04
  • The command shows the following outputs /apps/rmb/scripts$find / -name sql.h find: 0652-081 cannot change directory to : : The file access permissions do not allow the specified action. find: 0652-081 cannot change directory to : : The file access permissions do not allow the specified action. find: 0652-081 cannot change directory to : : The file access permissions do not allow the specified action. find: 0652-081 cannot change directory to : – Jackson2489 Feb 08 '15 at 10:52
  • Hi Alk, I found sql.h Now please help me how to use this to compile my C program – Jackson2489 Feb 08 '15 at 11:05
  • /usr/local/easysoft/unixODBC/include$ls odbcinst.h odbcinstext.h sql.h sqlext.h sqltypes.h sqlucode.h unixodbc_conf.h – Jackson2489 Feb 08 '15 at 11:06

1 Answers1

0

The code seems to be not formatted properly. I tried to do it again and again but it still shows the same thing.

Actually the headers were sql.h and stdio.h and a empty main program.

Please don't think like the program has typo errors. It is not formatted properly.

Jackson2489
  • 11
  • 3
  • 10